PageBridge
Recover traffic from your best content. PageBridge syncs Google Search Console data into Sanity Studio so you detect decay and fix it without leaving your editor.
Install command
npm i @pagebridge/sanity
PageBridge
Don't just publish content. Keep it.
PageBridge syncs Google Search Console data into Sanity Studio — so you can detect content decay, track keyword performance, and take action without leaving your editor.
How It Works
Google Search Console → PageBridge CLI → PostgreSQL → Sanity Studio
(nightly sync) (metrics) (insights)Install — Add the plugin to your Sanity Studio. One dependency, zero lock-in.
Connect — Authenticate with Google Search Console. PageBridge syncs your data to Postgres nightly.
Act — Open any document in Sanity. See live performance data, decay warnings, and keyword gaps in the sidebar.
Features
- Inline Performance Data — See clicks, impressions, CTR, and position right inside the Sanity document sidebar while you edit.
- Content Decay Detection — Automatic alerts when a page drops in rankings. Catch the slide before traffic disappears.
- Landing Page Intelligence — Works on modular page-builder schemas, not just blog posts. See which keywords drive leads to specific landing pages.
- Striking Distance Queue — Surfaces pages ranking between Position 4–10 with high impressions. These are your quick wins.
- Refresh Tasks — Generates actionable tasks in Sanity Studio for pages that need attention.
- URL Diagnostics — Detailed diagnostics for unmatched URLs so you can debug slug mismatches instantly.
Quick Start
1. Install packages
pnpm add @pagebridge/sanity
pnpm add -D @pagebridge/cli2. Add the plugin to Sanity Studio
// sanity.config.ts
import { defineConfig } from "sanity";
import { pageBridgePlugin } from "@pagebridge/sanity";
export default defineConfig({
// ...
plugins: [pageBridgePlugin()],
});3. Configure environment variables
Create a .env.local (or .env) file. PageBridge uses a PAGEBRIDGE_ prefix to avoid conflicts with your existing env vars:
# Google Service Account JSON (stringified)
PAGEBRIDGE_GOOGLE_SERVICE_ACCOUNT='{"type":"service_account",...}'
# PostgreSQL connection string
PAGEBRIDGE_DATABASE_URL='postgresql://postgres:postgres@localhost:5432/pagebridge'
# Sanity Studio configuration
PAGEBRIDGE_SANITY_PROJECT_ID='your-project-id'
PAGEBRIDGE_SANITY_DATASET='production'
PAGEBRIDGE_SANITY_TOKEN='sk...'
# Your website base URL
PAGEBRIDGE_SITE_URL='https://your-site.com'4. Set up the database
# Start PostgreSQL (or use an existing instance)
docker run -d --name pagebridge-db \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=pagebridge \
-p 5432:5432 \
postgres:165. Run your first sync
pnpm pagebridge sync --site sc-domain:your-site.com --migrateThat's it. Open Sanity Studio — you'll see performance data in the sidebar and a Refresh Queue tool for decaying content.
For the full setup guide, see pagebridge.io/docs/quick-start.
Packages
This is a Turborepo monorepo. All packages are 100% TypeScript.
| Package | Description | npm |
|---|---|---|
@pagebridge/sanity | Sanity Studio v3 plugin — schemas, performance pane, refresh queue | |
@pagebridge/cli | CLI for syncing GSC data, running diagnostics, and managing setup | |
@pagebridge/core | Sync engine, decay detection, URL matching, task generation | |
@pagebridge/db | Drizzle ORM schema and PostgreSQL client |
CLI Commands
pagebridge init # Interactive setup wizard
pagebridge doctor # Diagnose configuration issues
pagebridge sync --site <url> # Sync GSC data and detect decay
pagebridge list-sites # List accessible GSC properties
pagebridge diagnose # Debug unmatched URLsSee the CLI README for full command reference.
Content Decay Detection
PageBridge watches for three decay signals:
| Signal | Trigger | Window |
|---|---|---|
| Position decay | Position drops 3+ spots | 28 days |
| Low CTR | CTR < 1% for pages in top 10 | Current |
| Impressions drop | 50%+ drop in impressions | 28 days |
Recently published content (default: 45 days) is automatically excluded to avoid false positives.
Development
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Development mode
pnpm dev
# Lint and type check
pnpm lint
pnpm check-typesContributing
See CONTRIBUTING.md for guidelines.