Interim hand-authored reference. This page is authored from the SeamSDK public Swift sources. See the reference overview for context.
Overview
Seam is a public final class that conforms to ObservableObject. It exposes a shared singleton and the full public API for initializing the SDK, observing credentials, triggering unlocks, and tearing down the session.
- Bootstrapping the SDK at app launch (
initialize+activate). - Observing
credentialschanges reactively in SwiftUI or Combine. - Triggering a manual credential refresh on pull-to-refresh.
- Unlocking a door via Combine publisher with per-attempt proximity control.
- Cleaning up resources on logout or account switch with
deactivate().
Shared Instance
shared
The shared singleton instance of Seam. Use this to interact with the SDK after initialization.
Type Methods
initialize(clientSessionToken:)
Sets up the SDK with the provided client session token. Must be called before any other SDK methods.
| Parameter | Type | Description |
|---|---|---|
clientSessionToken | String | A valid client session token string. |
| Error | Description |
|---|---|
SeamError.invalidClientSessionToken | The provided token is malformed or invalid. |
SeamError.deactivationInProgress | A deactivation operation is already running. |
SeamError.alreadyInitialized | The SDK is already initialized without prior deactivation. |
- Initializing without a token will attempt to use the previous session if still valid.
- Thread-safe: can be invoked from any thread.
- To reinitialize, call
deactivate(deintegrate:)first.
Instance Properties
credentials
A published list of current credentials, automatically synchronized in the background.
refresh() to trigger an explicit sync (for example, on pull-to-refresh).
See also: SeamCredential, refresh()
isActive
A published Boolean indicating whether the SDK is currently active.
Instance Methods
activate()
Starts the SDK to begin credential synchronization and processing.
| Error | Description |
|---|---|
SeamError.initializationRequired | initialize(clientSessionToken:) has not been called. |
SeamError.deactivationInProgress | A deactivation operation is in progress. |
refresh()
Requests the latest credential list and updates the published credentials property.
SeamCredential values.
Throws
| Error | Description |
|---|---|
SeamError.initializationRequired | The SDK has not been initialized. |
SeamError.deactivationInProgress | A deactivation operation is in progress. |
refresh() is optional and intended for explicit user-initiated sync (for example, pull-to-refresh UI).
unlock(using:proximity:timeout:)
Unlocks a door or device using the given credential ID.
| Parameter | Type | Default | Description |
|---|---|---|---|
credentialId | String | — | The ID of the credential to use. |
proximity | SeamUnlockProximity? | nil | Required proximity for this attempt. If nil, uses the credential’s default (the first value in SeamCredential.supportedUnlockProximities). |
timeout | TimeInterval | 10.0 | Maximum seconds to wait for the unlock operation. |
SeamUnlockEvent values as the operation progresses.
Throws
| Error | Description |
|---|---|
SeamError.initializationRequired | initialize(clientSessionToken:) has not been called. |
SeamError.invalidCredentialId | No credential matches the provided identifier. |
SeamError.integrationNotFound | The lock provider integration for the credential is not configured. |
SeamError.credentialErrors([SeamCredentialError]) | The credential has one or more associated errors. |
SeamUnlockProximity, SeamUnlockEvent, SeamCredential.supportedUnlockProximities
deactivate(deintegrate:)
Stops the SDK and releases resources, optionally removing device association.
| Parameter | Type | Default | Description |
|---|---|---|---|
deintegrate | Bool | false | If true, performs full deintegration and removes device endpoints. If false, logs out but retains device endpoints. |
initialize()must have been called first.- Safe to call multiple times; idle calls are no-ops.

