Authentication in the SDK
An app holds a publishable key and a session token your server mints. The server holds the secret key, which no Android or iOS build can even name.
On the JVM, a client over the secret key mints a token for the member your own sign-in vouches for:
Answer the app with that Session as JSON. The server quickstart serves it.
SessionTokenEngine mints through your server and refreshes before each token expires. Hand it to the client as the token's source:
A request made before the first token waits for it. Call sessions.refresh() after a sign-in, and sessions.disable() on a sign-out.
A visitor holding a share link reads the shared resource with its token in place of the key:
A write, a collaboration stream or an agent run acts as a member. Mint its token for that member and for Embedded Studio:
The app's client then writes as that member:
Credential.Secret and Credential(secretKey = …) are declared on the JVM alone. An Android or iOS build has no symbol to call, so a secret key cannot ship in an app by mistake.