> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Seam

> Manages the Seam SDK lifecycle: initialization, activation, credential sync, unlock operations, and cleanup.

## Overview

```swift theme={null}
final class Seam
```

Manages the Seam SDK lifecycle: initialization, activation, credential sync, unlock operations, and cleanup.

***

## Instance Properties

### `credentials`

A published list of current credentials, automatically synchronized in the background. Subscribe to updates to refresh your UI or business logic.

```swift theme={null}
@Published var credentials: [SeamCredential] { get set }
```

### `isActive`

A published Boolean indicating whether the SDK is active. Use this to enable or disable UI or logic based on the SDK’s activation state.

```swift theme={null}
@Published var isActive: Bool { get set }
```

***

## Instance Methods

### `activate()`

Starts the SDK to begin credential synchronization and processing.

```swift theme={null}
func activate() async throws
```

### `deactivate(deintegrate:)`

Stops the SDK and releases resources, optionally removing device association.

```swift theme={null}
func deactivate(deintegrate: Bool = false) async
```

**Parameters**

| Parameter     | Description                                                                                                       |
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
| `deintegrate` | If `true`, performs a full deintegration; if `false`, logs out and retains device endpoints. Defaults to `false`. |

### `refresh()`

Requests the latest credential list and updates the published `credentials` property.

```swift theme={null}
func refresh() async throws -> [SeamCredential]
```

### `unlock(using:proximity:timeout:)`

Unlocks a door or device using the given credential ID.

```swift theme={null}
func unlock(using credentialId: String, proximity: SeamUnlockProximity? = nil, timeout: TimeInterval = 10.0) throws -> AnyPublisher<SeamUnlockEvent, Never>
```

**Parameters**

| Parameter      | Description                                                                                                                                            |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `credentialId` | The identifier of the credential to use for unlocking.                                                                                                 |
| `proximity`    | The **required proximity** for this unlock attempt. If `nil`, the SDK uses the credential’s default (the first value in `supportedUnlockProximities`). |
| `timeout`      | The maximum time, in seconds, to wait for the unlock operation. Defaults to 10.                                                                        |

***

## Type Properties

### `shared`

The shared singleton instance of `Seam`.

```swift theme={null}
static let shared: Seam
```

***

## Type Methods

### `initialize(clientSessionToken:)`

Sets up the SDK using the provided client session token.

```swift theme={null}
static func initialize(clientSessionToken: String) throws
```

**Parameters**

| Parameter            | Description                                     |
| -------------------- | ----------------------------------------------- |
| `clientSessionToken` | Optional - A valid client session token string. |
