Prerequisites
- Android project with Compile SDK 35 and Kotlin 2.1.0+
- Seam Android SDK installed (see Installation)
- A client session token (CST) from the Seam API for the current user
Overview
The integration follows three steps:- Initialize — Bootstrap the SDK once with a client session token.
- Activate — Sync credentials and start background services.
- Unlock — Observe credentials and trigger the unlock flow.
Initialize the SDK
Call
SeamSDK.initialize() once per user session — the best place is Application.onCreate() or immediately after sign-in. It is a suspend function, so call it from a coroutine.initialize is idempotent and thread-safe. Calling it a second time with the same token is a no-op. To re-initialize with a different token, call deactivate(deintegrate = true) first.Activate and observe credentials
After initialization, call
activate() to sync credentials from the server. Then collect the credentials StateFlow to react to credential updates in your UI.credentials is a StateFlow — it emits the current list immediately upon collection and then again whenever the list changes. Use lifecycleScope.launch or repeatOnLifecycle in a Fragment or Activity to automatically cancel collection when the view is destroyed.Perform an unlock
Before calling
unlock(), subscribe to unlockStatus so you receive all progress events. Pass the credential ID and an optional timeout. The unlock() call returns a Job that you can cancel if needed.Always check
credential.errors before unlocking. If a credential has unresolved errors (for example, Loading or UserInteractionRequired), the unlock call will throw SeamError.CredentialErrors. See Error Handling for details.Complete Example
The following shows the three steps wired together in a minimal Activity:Next Steps
- Architecture — Deep dive into StateFlows, coroutine context, offline caching, and SDK lifecycle.
- Error Handling — All
SeamErrorsubtypes and credential error patterns. - API Reference — Full reference for
SeamSDK,SeamCredential, and related types.

