ReadonlycookieCookie-only view for cookie-backed sessions.
Grant-backed sessions return undefined.
ReadonlygrantGrant-only management view for grant-backed sessions.
Cookie-backed sessions return undefined.
ReadonlyinfoRetrieve immutable info about this session (user & capabilities).
ReadonlystorageAccess the session-scoped storage API (read/write).
Export the session metadata so it can be restored after a tab refresh.
The export string contains no secrets; it only serializes the public SessionInfo.
Browsers remain responsible for persisting the HTTP-only session cookie.
A base64 string to store (e.g. in localStorage).
Export the local secret material needed to restore this session.
For local grant sessions this exports the grant JWS and PoP client secret;
restoring mints a fresh bearer. For legacy cookie sessions this exports the
cookie secret when the SDK owns it. Delegated browser grant sessions cannot
export raw secret material; use BrowserSessionStore.
Treat the returned string as a bearer-equivalent secret until the grant or cookie session expires or is revoked.
A secret token that can be passed to pubky.restoreSession().
Invalidate the session on the server (clears server cookie). Further calls to storage API will fail.
StaticrestoreRestore a session from an export() string.
The HTTP-only cookie must still be present in the browser; this function does not read or write any secrets.
A string produced by session.export().
Optionalclient: Client | null
Optional client to reuse transport configuration.
An authenticated context “as the user”.
storagefor reads/writes (absolute paths like/pub/app/file.txt)