Skip to content

Document page and visitor context in webframes#1230

Open
gregberge wants to merge 3 commits into
mainfrom
greg/rnd-11604-provide-current-page-pathid-to-webframe-in-integration-block
Open

Document page and visitor context in webframes#1230
gregberge wants to merge 3 commits into
mainfrom
greg/rnd-11604-provide-current-page-pathid-to-webframe-in-integration-block

Conversation

@gregberge

@gregberge gregberge commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Documents how integration webframes receive contextual data and can navigate, via the postMessage state / actions:

  • state.page — the current page as { id, path, title }. Always available (no scope).
  • state.visitor — visitor claims, with the existing site:visitor:claims scope (previously undocumented).
  • @webframe.navigate — navigate the reader to another page in the site.

Why

Part of RND-11604. Frontend implementation: GitbookIO/gitbook#4362.

Changes

  • configurations.md: document the existing site:visitor:claims scope (no new scope added).
  • contentkit/interactivity.md + guides/interactivity.md: new "Page and visitor context" and "Navigating to another page" sections.
  • development/contentkit/reference.md: note the reserved state keys and the navigate action in the webframe reference.

Docs-only; no changeset (docs are not a versioned package in this repo).

🤖 Generated with Claude Code

Add the site:page:context scope (and the previously undocumented site:visitor:claims) and document that webframes receive state.page ({ id, path, title }) and state.visitor through the postMessage state, in the interactivity guides and the ContentKit component reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: da74361

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

bun add https://pkg.pr.new/GitbookIO/integrations/@gitbook/api@1230

commit: da74361

@gregberge gregberge requested a review from spastorelli July 3, 2026 12:29
gregberge and others added 2 commits July 3, 2026 14:56
Per review, the current page is exposed to webframes without a dedicated scope, so remove site:page:context from the scopes list and reword the interactivity and reference docs (page is always available; visitor claims still need site:visitor:claims). Also document the @webframe.navigate action for navigating to another page in the site.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The @webframe.navigate path is resolved relative to the site root, so it can target any section or space.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant