Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.discovr.media/llms.txt

Use this file to discover all available pages before exploring further.

Subscribes to session refresh events. Fires whenever a new session JWT is minted — on selectProfile(), the automatic 30-minute refresh, and SESSION_EXPIRED recovery. Each new session means the recommendation snapshot has turned over and your cached page data is stale.

Parameters

NameTypeRequiredDescription
cb (TypeScript)callbackYesFunction called with { profileId, expiresAt } when a new session is minted.

Returns

Unsubscribe — Unsubscribe function (TS only; Kotlin/Swift use Flow/AsyncStream lifecycle). expiresAt is Unix seconds.

Example

client.onSessionRefreshed(({ profileId, expiresAt }) => {
  console.log("New session minted. Existing pages are now stale.");
  recreateHomePage();
});