# Importing and Initializing

#### **Import the Framework**

Add the following line at the top of any Swift file where you want to use the SDK:

```swift
import Mpc
```

#### **Initialize the SDK**

Initialize the SDK in AppDelegate.swift or SceneDelegate.swift, depending on your project setup.

```swift
import UIKit
import Mpc

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Get the window from the first connected scene
        guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
              let window = windowScene.windows.first else {
            fatalError("No window found")
        }
        
        let passkey = PasskeyClientImpl(
            window: window,
            apiKey: "API_KEY",
            authServerAddress: "AUTH_SERVER_ADDRESS"
        )
        let client = MpcClient(
            "YOUR_SERVER_ADDRESS", 
            "YOUR_TOKEN",
            "YOUR_MODE",
            "AUTH_SERVER_ADDRESS",
            "MAIN_SERVER_ADDRESS",
            passkey
        )
        client.initClient()
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cramiumlabs.gitbook.io/docs/sdk-mpc-ios/importing-and-initializing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
