After signing in with a refresh token, you’ll select a profile before calling the API. Each profile gets its own recommendation state.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.
After sign-in: Select a profile
The SDK stores your identity credential securely. When you call API methods, it automatically handles creating and refreshing a session. You just need to select a profile first.Profiles: Separate recommendations per user
Profiles let users on the same device have separate recommendations. Each profile has its own recommendation history, watchlist, liked items, and playback state. After sign-in, list profiles withgetProfiles() and select one with selectProfile() before calling the API.
For a dedicated walkthrough—who’s watching UX, avatar pickers, and CRUD—see Profiles.
List and select a profile
Switch profiles
CallingselectProfile() again with a different id (or using switchProfile() where available) switches profiles and creates a new session, which also loads fresh recommendations for that profile.
Sign out
CallsignOut() to revoke the current device’s refresh token and clear all locally stored credentials. Other devices the user is signed into are not affected.
Revocation is immediate. Any in-flight API requests complete normally, then the SDK signs out. Sign-out also triggers
onAuthStateChanged() / authState /
authStateStream with signedIn: false.Reactive state
The SDK exposes two observers for state changes that happen internally — sign-in completion, profile switches, and session renewal. Both fire immediately with current state on subscribe.Auth state
Fires on every sign-in (all flows), profile switch, and sign-out. Use it to update your UI’s logged-in state and profile display.Session refreshed
Fires whenever a new session is created: on the initialselectProfile(), the automatic background refresh, and after SESSION_EXPIRED recovery. Subscribe with onSessionRefreshed() (TypeScript) or sessionState / sessionStateStream (Kotlin/Swift). Each new session produces fresh recommendations — any page data your app has cached is stale.
The recommended pattern is to recreate your page on every session refresh.
Advanced: Token refresh & storage
Related SDK reference
getProfiles · selectProfile · switchProfile · createPage · signOut · onAuthStateChanged · onSessionRefreshedNext: Handle authentication errors