Studio Structure
PageBridge provides structure helpers to organize its document types and add performance views to your content documents.
createPageBridgeStructure
Adds a "PageBridge" folder to your Studio sidebar containing Sites, Snapshots, and Refresh Tasks list views.
import { createPageBridgeStructure, PAGEBRIDGE_TYPES } from '@pagebridge/sanity'
structure: (S) =>
S.list()
.title('Content')
.items([
// PageBridge folder at the top
createPageBridgeStructure(S),
S.divider(),
// Your other document types (excluding PageBridge internals)
...S.documentTypeListItems().filter(
(item) => !PAGEBRIDGE_TYPES.includes(item.getId() as string)
)
])createGscStructureResolver
Adds a Performance view tab alongside the default form view on content documents. This is where editors see search metrics for each page.
import { createGscStructureResolver } from '@pagebridge/sanity'
defaultDocumentNode: createGscStructureResolver(['post', 'page', 'article'])Pass all content types that you configured in any gscSite document's urlConfigs array. Documents of these types will show two tabs: Content (the normal form) and Performance (search metrics).
PAGEBRIDGE_TYPES
An array of PageBridge document type names: ["gscSite", "gscSnapshot", "gscRefreshTask"]. Use this to filter PageBridge types from default document lists so they only appear in the PageBridge folder.
Configuring a GSC Site document
After setting up the structure, create a gscSite document in Studio:
| Field | Example | Description |
|---|---|---|
siteUrl | sc-domain:example.com | Exactly as it appears in Google Search Console |
urlConfigs | Array of:{{ contentType: 'post', slugField: 'slug', pathPrefix: '/blog' }}{{ contentType: 'page', slugField: 'slug' }} | Per-content-type URL configurations. Each entry specifies the content type, slug field, and optional path prefix. Omit pathPrefix for root-level URLs. |
defaultLocale | en | For internationalized content |