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

# Mobile SDK Configuration

> How to configure the Suki Mobile SDK

To use the Suki **mobile SDK**, you must configure it when your application starts. Follow these steps to **initialize** the SDK.

## How authentication works

The Mobile SDK does not host clinician sign-in. Your app authenticates the clinician, then supplies a Partner Token through `TokenProvider` when the SDK needs one.

Clinician signs in

Your existing login screen or SSO; Suki does not host sign-in

TokenProvider

Return a valid Partner Token when the SDK requests one

Mobile SDK is ready

Ambient capture and session APIs are available after initialize()

## Configure the SDK

Follow these steps to configure the Suki Mobile SDK:

**1. Import the Framework**

In the Swift file where you will manage the SDK, **import** the framework:

```swift Import Framework theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
import SukiAmbientCore
```

**2. Set the SDK Environment**

Set the SDK environment by assigning a value to the `SukiAmbientCoreManager.shared.environment` property. The recommended environments are `.stage` and `.prod`.

```swift Set Environment theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
// Set the SDK environment (recommended: .stage or .prod)
SukiAmbientCoreManager.shared.environment = .stage
```

**3. Initialize the SDK**

Call the `initialize` method to configure the SDK. Call this method after a user signs in. If sign-in sessions persist, call it in your application delegate's `didFinishLaunchingWithOptions` method.

```swift Initialize SDK theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    do {
        let partnerInfo: [String: AnyHashable] = [
            SukiAmbientConstant.kPartnerId: "123",
            SukiAmbientConstant.kProviderInfo: [
                SukiAmbientConstant.kOrgId: "provider_org_id",
                SukiAmbientConstant.kName: "Patrick Smith", // replace this with the provider's name
                SukiAmbientConstant.kId: "providerId",
                SukiAmbientConstant.kSpeciality: "FAMILY_MEDICINE"
            ]
        ]
        try SukiAmbientCoreManager.shared.initialize(
            withPartnerInfo: partnerInfo,
            with: true, // Set to true if your app supports background recording
            onCompletion: { result in
                // Handle initialization result
            },
            withSessionDelegate: self,
            withTokenProvider: self
        )
    } catch {
        print(error)
    }
}
```

### Initialization parameters

The `initialize` method takes the following parameters:

**partnerInfo** `dictionary`

A dictionary containing partner and provider details.

**SukiAmbientConstant.kPartnerId** `string`

Your Partner ID.

**SukiAmbientConstant.kProviderInfo** `dictionary`

Provider details for the signed-in clinician.

**ProviderInfo keys**

**SukiAmbientConstant.kId** `string`

Provider identifier. String key: `"Id"`. **Required for Bearer partners** so login and register receive `provider_id` when it is not present in the JWT. Omit or leave unused for partners that already supply provider identity in the token.

**SukiAmbientConstant.kOrgId** `string`

Provider organization id.

**SukiAmbientConstant.kName** `string`

Provider display name.

**SukiAmbientConstant.kSpeciality** `string`

Provider specialty catalog value.

**backgroundRecording** `boolean`

Set this to `true` if your app supports background recording. If `true`, recording continues when the app is in the background. Otherwise, recording pauses and you must resume it when the app returns to the foreground.

**onCompletion** `completionHandler`

A completion handler that is called with the result of the initialization, indicating success or failure.

**sessionDelegate** `delegateObject`

An optional delegate object to receive callbacks for recording-level events.

**tokenProvider** `TokenProvider`

An object that conforms to the `tokenProvider` protocol. Your application (client application) is responsible for providing a valid token when the SDK requests one through this protocol.

> [!NOTE]
>
> The `tokenProvider` is used for authenticating the mobile SDK. You must implement this `tokenProvider` protocol to get authentication tokens when needed.

## Error handling

The `initialize` method can throw a `SukiAmbientCoreError`. You should use a **do-catch** block, as shown in the example above, to handle any potential errors during initialization.

> [!NOTE]
>
> **Bearer partners using the Mobile SDK:**
>
> * When initializing the Mobile SDK, pass the `providerId` in `ProviderInfo` using `SukiAmbientConstant.kId`. If the JWT does not include a `provider_id` claim, the SDK uses this value as `provider_id` in the authentication and registration requests.
>
> * For more information, refer to [Bearer partner authentication](https://developer.suki.ai/api-reference/bearer-partner-authentication.md).

## Next steps

&#x20;**[Create ambient session](https://developer.suki.ai/mobile-sdk/ambient-guides/create-session.md)** - Using Mobile SDK features.

&#x20;**[Ambient interoperability](https://developer.suki.ai/mobile-sdk/ambient-guides/ambient-interoperability.md)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.