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

# ClicktermClient

> Initialize and manage the ClickTerm iOS SDK.

`ClicktermClient` is the entry point for the ClickTerm iOS SDK. Initialize it once before displaying a clickwrap.

## Initialize

```swift theme={null}
ClicktermClient.initialize(
    appId: String,
    environment: ClicktermEnvironment = .production
)
```

| Parameter     | Type                   | Required | Description                                                                      |
| ------------- | ---------------------- | -------- | -------------------------------------------------------------------------------- |
| `appId`       | `String`               | Yes      | Your App ID from the [Integrations page](https://app.clickterm.com/integrations) |
| `environment` | `ClicktermEnvironment` | No       | Uses `.production` by default                                                    |

Call `initialize()` when your app starts:

```swift theme={null}
import ClicktermSDK
import SwiftUI

@main
struct ExampleApp: App {
    init() {
        ClicktermClient.initialize(appId: "YOUR_CLICKTERM_APP_ID")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
```

<Warning>
  The App ID cannot be empty. Calling other SDK methods before initialization
  throws `ClicktermError.notInitialized`.
</Warning>

<Warning>
  Never expose your **App Key** in client-side code. The App Key is used
  only for backend verification calls. The client SDK uses only the **App ID**.
  Store the App Key safely — it won't display again after creation, but can be
  regenerated. Regenerating the key requires updating your backend configuration.
</Warning>

## Shut down

```swift theme={null}
ClicktermClient.shutdown()
```

`shutdown()` clears the current SDK configuration and loaded translations. Call it when signing out a user or replacing the active SDK configuration. Call `initialize()` again before the next SDK operation.

## Lower-level requests

Most apps should use [`ClicktermDialog`](/dev/sdk/ios/clickterm-dialog). These lower-level methods are available when you need to build your own presentation:

```swift theme={null}
try await ClicktermClient.fetchTemplateContent(request)
try await ClicktermClient.fetchAcceptedTemplateContent(request)
try await ClicktermClient.fetchCustomizationSettings(
    clickwrapTemplateId: "YOUR_TEMPLATE_ID"
)
try await ClicktermClient.sendAgreement(event)
```

All request methods use Swift concurrency and can throw a [`ClicktermError`](/dev/sdk/ios/results-errors).
