docs: guide for shared sessions across subdomains - #150
Open
sea-snake wants to merge 1 commit into
Open
Conversation
This was referenced Aug 14, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new documentation guide describing how to share a single Internet Identity session across sibling subdomains, using the new configurable delegation storage APIs introduced in #149, and wires it into the docs sidebar.
Changes:
- New guide: shared sessions across subdomains (
derivationOrigin+SyncCookieStorage+ silentprompt: 'none'acquisition withhint). - Documents reacting to session changes via
AuthClient.subscribe()and cleanup viaunsubscribe()/dispose(). - Adds the guide to the docs sidebar under a new “Guides” section.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/src/content/docs/shared-sessions.md | Adds an end-to-end guide for cross-subdomain shared sessions (configuration, sign-in/out, silent acquisition, subscriptions). |
| docs/src/content/docs/_sidebar.json | Exposes the new guide in navigation under “Guides”. |
Suppressed comments (2)
docs/src/content/docs/shared-sessions.md:61
- With
transport: 'redirect',signIn()must run on page load so the flow can replay and complete on the return redirect. The current example startssignIn()from a click handler, which means the return load may never re-runsignIn()and the session won’t be established.
document.querySelector('#signin').onclick = () => {
new AuthClient({ ...shared, prompt: 'login' }).signIn();
};
docs/src/content/docs/shared-sessions.md:97
- This overpromises cross-subdomain propagation:
SyncCookieStorage.subscribe()can notify immediately only via the Cookie Store API; otherwise it re-checks onvisibilitychange/pageshow, so an always-visible tab may not update until it becomes visible again.
`AuthClient.subscribe` fires when the session changes elsewhere, so an open page
can update without a reload. A sign-out on any subdomain, or a sign-in in another
tab of the same origin, reaches every subscribed client.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
from
August 14, 2026 14:24
5a91ea0 to
d740828
Compare
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
from
August 14, 2026 15:02
d740828 to
baf266c
Compare
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
10 times, most recently
from
August 17, 2026 09:03
ba0ce1c to
eaef984
Compare
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
6 times, most recently
from
August 17, 2026 10:07
76c0c54 to
6cb85e9
Compare
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
from
August 17, 2026 10:17
6cb85e9 to
bda2a17
Compare
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
2 times, most recently
from
August 17, 2026 10:40
e367acb to
f282199
Compare
Explains sharing one sign-in across sibling subdomains via SyncCookieStorage + a silent prompt: 'none' acquisition on page load, and reacting to cross-tab / cross-subdomain session changes with AuthClient.subscribe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sea-snake
force-pushed
the
feat/auth-shared-session-docs-v2
branch
from
August 17, 2026 11:09
f282199 to
5aa78d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #149 (configurable storage).
A guide explaining how to share one sign-in across sibling subdomains of a single domain:
derivationOriginfor a shared principal, plusCookieDelegationStorage(via the newdelegationStorageoption) to share the sign-in state.prompt: 'none'acquisition on page load, using the hint cookie's announced principal (CookieDelegationStorage.readHint()) ashint.AuthClient.subscribe, and releasing the listener withunsubscribe()/dispose().Supersedes #147 (built on the old storage API — used the removed
syncStorageoption andKEY_STORAGE_DELEGATION).🤖 Generated with Claude Code