> ## 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.

## Configure the SDK

Follow these steps to configure the Suki Mobile SDK:

<Steps>
  <Step title="Import the framework">
    In the Swift file where you will manage the SDK, **import** the framework:

    <CodeGroup>
      ```swift Import Framework theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
      import SukiAmbientCore
      ```
    </CodeGroup>
  </Step>

  <Step title="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`.

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

  <Step title="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.

    <CodeGroup>
      ```swift Initialize SDK theme={"theme":{"light":"github-dark","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 SukiAmbientCore.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)
          }
      }
      ```
    </CodeGroup>
  </Step>
</Steps>

### Initialization parameters

The `initialize` method takes the following parameters:

<ResponseField name="partnerInfo" type="dictionary">
  A dictionary containing partner and provider details.

  <Tip>
    These parameters are not actively used in the current version, as the SDK is designed for a single user with one specialty. The method signature may change in a future release.
  </Tip>
</ResponseField>

<ResponseField name="backgroundRecording" type="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.
</ResponseField>

<ResponseField name="onCompletion" type="completionHandler">
  A completion handler that is called with the result of the initialization, indicating success or failure.
</ResponseField>

<ResponseField name="sessionDelegate" type="delegateObject">
  An optional delegate object to receive callbacks for recording-level events.
</ResponseField>

<ResponseField name="tokenProvider" type="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.
  </Note>
</ResponseField>

## 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.

## Next steps

<Icon icon="file-lines" iconType="solid" /> After you configure the SDK, proceed to our [Ambient guides](/mobile-sdk/ambient-guides/create-session) to start using the mobile SDK features.
