Skip to main content
Interim hand-authored reference. This page is authored directly from the Seam Android SDK public Kotlin sources. See the reference overview for context.

Overview

SeamCredential is a data class representing a single access credential as an immutable value snapshot. Read credentials from SeamSDK.getInstance().credentials; never construct them manually in production — the SDK manages their lifecycle.
data class SeamCredential(
    val id: String?,
    val supportedUnlockProximities: List<UnlockProximity>,
    val name: String,
    val location: String?,
    val expiry: LocalDateTime?,
    val cardNumber: String?,
    val code: String?,
    val errors: List<SeamCredentialError>,
    val isManaged: Boolean = true,
    val providerName: String
)
Notes
  • Instances are immutable snapshots. To get the latest state, collect SeamSDK.getInstance().credentials or call SeamSDK.getInstance().refresh().
  • Managed credentials (isManaged = true) are created and controlled by the Seam API. Unmanaged credentials (isManaged = false) are discovered directly through a provider integration running on-device.
  • id is nullable — always null-check before passing it to unlock().

Properties

PropertyTypeDescription
idString?Unique identifier for this credential. May be null for some provider types.
nameStringDisplay name for this credential.
locationString?Human-readable location associated with the credential (for example, building or door name).
expiryLocalDateTime?Expiration date and time, if the credential has one.
cardNumberString?Card number associated with the credential, if any.
codeString?Access code associated with the credential, if any.
errorsList<SeamCredentialError>Active errors affecting this credential. Check this list before attempting to unlock.
supportedUnlockProximitiesList<UnlockProximity>Proximity levels this credential supports, ordered by preference.
isManagedBooleantrue if this credential was created and managed by the Seam API; false if discovered by a provider integration. Defaults to true.
providerNameStringIdentifies the access control provider that issued this credential.

supportedUnlockProximities — Proximity requirements

supportedUnlockProximities expresses the proximity levels acceptable for an unlock using this credential. The list is ordered by preference:
  • When SeamSDK.getInstance().unlock() is called without an unlockProximity argument, the first value in this list is used as the default.
  • Pass any supported value explicitly via the unlockProximity parameter.
See also: UnlockProximity, SeamSDK.unlock()

providerName — Known values

The providerName field identifies the access control provider that issued the credential. Known values:
ValueProvider
"hid_origo_credential_service"HID Origo
"salto_ks"Salto KS
"brivo"Brivo
"assa_abloy_credential_service"ASSA ABLOY Credential Service
"visionline_system"ASSA ABLOY Visionline
"latch"Latch
"assa_abloy_vostio"ASSA ABLOY Vostio
"assa_abloy_vostio_credential_service"ASSA ABLOY Vostio Credential Service
"salto_space"Salto Space
Additional providers may be added in future SDK releases. Treat unrecognized values gracefully.

Example

lifecycleScope.launch {
    SeamSDK.getInstance().credentials.collect { credentials ->
        credentials.forEach { credential ->
            // Check for errors before attempting to unlock
            if (credential.errors.isEmpty()) {
                val credentialId = credential.id ?: return@forEach
                SeamSDK.getInstance().unlock(credentialId = credentialId)
            } else {
                // Handle credential errors
                credential.errors.forEach { error ->
                    when (error) {
                        is SeamCredentialError.Expired -> showExpiredBanner(credential)
                        is SeamCredentialError.Loading -> showLoadingIndicator(credential)
                        is SeamCredentialError.UserInteractionRequired -> {
                            handleUserInteraction(error.interaction)
                        }
                        is SeamCredentialError.Unknown -> showGenericError(credential)
                    }
                }
            }
        }
    }
}
See also: SeamCredentialError