After sign-in, the bridge keepsDocumentation Index
Fetch the complete documentation index at: https://setup.despia.com/llms.txt
Use this file to discover all available pages before exploring further.
window.clerkJWT populated and maintains an in-memory user snapshot you can read offline.
Session State
A full snapshot of the signed-in user and active session, read from the in-memory cache hydrated from the secure session store. No network round-trip, works fully offline. Calling it on a signed-in user also restarts the JWT refresher.The JWT
window.clerkJWT holds the current session token, auto-refreshed every 50 seconds (under Clerk’s 60-second TTL). Attach it as a Bearer token.
window.clerkJWT don’t see spurious churn. Failed refreshes (offline) leave the last good value in place rather than nulling it.
Refresher starts on configure, reconfigure, clerk://state while signed in, and any sign-in flow reaching complete. Stops on sign-out and reconfigure. When the app returns from the background, the bridge automatically refreshes the JWT (and re-syncs SSR cookies) before your code runs again, so a backgrounded app comes back with a fresh token.
Force a refresh
An on-demand JWT refresh, same source as the background refresher. Use this only when you need a guaranteed-fresh token right now.jwt is null when there is no session. Errors emit with event: "token": not_configured, token_fetch_failed (window.clerkJWT keeps last value), unsupported_os, sdk_not_linked.
Handling 401
Force a refresh and retry once.@clerk/backend and trust only the verified sub claim. Never trust a client-reported userId.
For middleware-based auth on Next.js, TanStack, and other frameworks, see Server-Side Auth.
Offline
Routes that work offline:clerk://state (in-memory cache) and window.clerkJWT reads (cached, refreshed in the background).
Routes that need network: clerk://token, all sign-in flows, OAuth, clerk://signout.
Resources
NPM Package
despia-native