refresh

suspend fun refresh(): List<SeamCredential>

Refreshes the credentials for the current app user.

Manually triggers a sync with the server to fetch latest credentials. This operation requires an active internet connection. You should call initialize and activate first.

The credentials StateFlow will be updated before this method returns. In most cases, automatic background sync makes manual refresh unnecessary.

val seamSDK = SeamSDK.getInstance()
try {
seamSDK.refresh()
} catch (seamError: SeamError) {
when (seamError) {
is SeamError.InitializationRequired -> {
// handle error when SDK is not initialized
}
is SeamError.ActivationRequired -> {
// handle error when app user has not been activated
}
is SeamError.InvalidClientSessionToken -> {
// handle error when client session token is invalid
}
is SeamError.InternetConnectionRequired -> {
// handle error when internet connection is required
}
else -> {
// handle other errors
}
}
}

Return

The updated list of credentials after refresh completes.

Throws

if the SDK has not been initialized yet.

if the app user has not been activated yet.

if the client session token is invalid.

if no internet connection is available.