pagebridge sync
The main command that syncs Google Search Console data, matches URLs, detects decay, and writes snapshots to Sanity.
Usage
pagebridge sync --site <url> [options]Options
| Flag | Type | Description |
|---|---|---|
--site <url> | string | Required. GSC site URL (e.g., sc-domain:example.com) |
--dry-run | boolean | Preview what would be synced without writing to the database or Sanity |
--skip-tasks | boolean | Sync data only — skip decay detection and task generation |
--check-index | boolean | Check Google index status for all matched pages via URL Inspection API |
--quiet-period <days> | number | Ignore content published within this many days (default: 45) |
--debug | boolean | Enable timing information for each sync phase |
--migrate | boolean | Run database migrations before syncing |
--google-service-account <json> | string | Override GOOGLE_SERVICE_ACCOUNT environment variable |
--db-url <url> | string | Override DATABASE_URL environment variable |
--sanity-project-id <id> | string | Override SANITY_PROJECT_ID environment variable |
--sanity-dataset <name> | string | Override SANITY_DATASET environment variable |
--sanity-token <token> | string | Override SANITY_TOKEN environment variable |
--site-url <url> | string | Override SITE_URL environment variable (your website base URL for URL matching) |
Examples
Basic sync
pagebridge sync --site sc-domain:example.comFull sync with index checking
pagebridge sync --site sc-domain:example.com --check-index --debugData only (no tasks)
pagebridge sync --site sc-domain:example.com --skip-tasksDry run preview
pagebridge sync --site sc-domain:example.com --dry-runRun with migrations
pagebridge sync --site sc-domain:example.com --migrateOutput
After a sync completes, you will see a summary including:
- Total rows processed
- Number of unique pages found
- Number of pages matched to Sanity documents
- Number of unmatched URLs
- Number of decay signals detected
- Number of refresh tasks created
- Index status counts (if
--check-indexwas used) - Timing breakdown (if
--debugwas used)
Unmatched URL diagnostics
Unmatched URLs are stored to the database during sync. After a sync completes, a hint is shown:
Run 'pagebridge diagnose --site <site>' for detailed diagnosticsUse the diagnose command to query stored diagnostics or live-test a specific URL against Sanity.
Data range
By default, the sync fetches data from 90 days ago to 3 days ago. The 3-day offset accounts for the delay in GSC data availability — Google typically takes 2-3 days to finalize search analytics.
Rate limits
When checking index status (--check-index), the CLI rate-limits requests to 100ms between each URL Inspection API call (600 requests per minute). Results are cached for 24 hours to avoid redundant checks.