CgsAuth
Opening a session, and choosing which profile it runs as.
Obtained from CGS.auth. The SDK does not sign users in itself: you authenticate them however you already do, get a host token from your backend, and exchange it here for an SDK session.
when (val result = CGS.auth().authenticate(hostToken)) {
is CgsResult.Success -> showContent() // or promptForProfile() — see selectProfile
is CgsResult.Failure -> showError(result.cgsError)
}The session is persisted and refreshed on its own — authenticate once, not on every launch. Check state at startup to know whether you still have one.
No profile is active until you choose one with selectProfile — the SDK never picks for you, and the profiles themselves are yours: you know them from your own backend, and the SDK does not hand back a list of its own. Whether to offer that choice is yours too: a session with no active profile reads perfectly well at account scope, so hosts without profiles can ignore selectProfile entirely.
Unless you asked it to pick. A host with no profiles of its own sets SdkConfig.Builder.selectsProfileAutomatically and never names a profile again: the SDK adopts the account's first one as soon as it learns of it, selectProfile is then rejected, and everything below reads the same.
Properties
Functions
Exchanges one of your own tokens for an SDK session, unlocking the content APIs.
Ends the session and erases what it left on the device — tokens, the active profile, and the cached content that was scoped to it.
Syncs the account's profiles from the backend.
Chooses which profile the session reads as.