# Migrate from Clerk iOS SDK v0 to v1

1. ## Update your package dependency

   Most apps add Clerk through Xcode's package UI. The easiest way to update is to remove the existing Clerk dependency and re-add it with an **Up to Next Major Version** rule so it resolves to v1, then pick the v1 products you need.
2. ### Xcode

   1. Remove the existing `Clerk` package from your project if it's already added.
   2. Open the **Package Dependencies** tab and select the **+** button.
   3. Search for `https://github.com/clerk/clerk-ios`.
   4. Select the `Clerk` package in the results list.
   5. Set **Dependency Rule** to **Up to Next Major Version**.
   6. Make sure your app target is selected in **Add to Project**, then select **Add Package**.
   7. In **Choose Package Products**, select `ClerkKit` (and `ClerkKitUI` only if you want to use Clerk's [prebuilt views](https://clerk.com/docs/reference/views/overview.md)), then select **Add Package**.

   Or, if you manage dependencies in `Package.swift`, use the configuration below:
3. ### Package.swift

   filename: Package.swift

   ```swift
   dependencies: [
     .package(url: "https://github.com/clerk/clerk-ios", from: "1.0.0"),
   ],
   targets: [
     .target(
       name: "YourApp",
       dependencies: [
         .product(name: "ClerkKit", package: "clerk-ios"),
         .product(name: "ClerkKitUI", package: "clerk-ios") // Optional if using ClerkKitUI
       ]
     ),
   ]
   ```
4. ## Update imports

   v1 splits imports by product: use `ClerkKit` for core APIs, and add `ClerkKitUI` for [AuthView](https://clerk.com/docs/reference/views/authentication/auth-view.md), [UserProfileView](https://clerk.com/docs/reference/views/user/user-profile-view.md), and other [prebuilt views](https://clerk.com/docs/reference/views/overview.md).

   ```swift
   // v0
   import Clerk
   ```

   ```swift
   // v1
   import ClerkKit // (custom flows)
   // AND, when using prebuilt views:
   import ClerkKitUI
   ```
5. ## Configuration

   v1 configures Clerk once at launch with a static `configure` call and no manual `load()` step.
   `Clerk.Settings` is now `Clerk.Options`. See the [iOS configuration reference](https://clerk.com/docs/reference/native-mobile/configuration.md#configuration-options) for the full list of options.

   ```swift
   // v0
   @main
   struct QuickstartApp: App {
     @State private var clerk = Clerk.shared

     var body: some Scene {
     WindowGroup {
       ContentView()
         .task {
           clerk.configure(publishableKey: "YOUR_PUBLISHABLE_KEY")
           try? await clerk.load()
         }
     }
     }
   }
   ```

   ```swift
   // v1
   @main
   struct QuickstartApp: App {
     init() {
       Clerk.configure(publishableKey: "YOUR_PUBLISHABLE_KEY")
     }

     var body: some Scene {
       WindowGroup {
         ContentView()
       }
     }
   }
   ```
6. ## Inject Clerk into the SwiftUI environment

   v1 injects the shared instance directly into SwiftUI's environment instead of using the custom v0 environment key.

   ```swift
   // v0
   WindowGroup {
     ContentView()
       .environment(\.clerk, clerk)
   }
   ```

   ```swift
   // v1
   WindowGroup {
     ContentView()
       .environment(Clerk.shared)
   }
   ```
7. ## Access Clerk state from the environment

   v1 reads `Clerk` from the typed environment value instead of the v0 key path.

   ```swift
   // v0
   struct ContentView: View {
     @Environment(\.clerk) private var clerk
   }
   ```

   ```swift
   // v1
   struct ContentView: View {
     @Environment(Clerk.self) private var clerk
   }
   ```
8. ## Start an auth flow

   Auth flows now live under `clerk.auth` instead of the static v0 `SignIn.create(...)` entry point.

   ```swift
   // v0
   let signIn = try await SignIn.create(
     strategy: .identifier(
       "user@email.com",
       password: "secretpassword"
     )
   )
   ```

   ```swift
   // v1
   @Environment(Clerk.self) private var clerk

   let signIn = try await clerk.auth.signInWithPassword(
     identifier: "user@email.com",
     password: "secretpassword"
   )
   ```

   See [Authentication flows](https://clerk.com/docs/reference/native-mobile/auth.md) for more authentication options and examples.
9. ## Migration checklist

   Use this list to confirm you've covered the v1 changes.

   - Update your SPM dependency to `from: "1.0.0"` and add `ClerkKit` / `ClerkKitUI` products.
   - Replace `import Clerk` with `import ClerkKit` (and add `import ClerkKitUI` when using prebuilt views).
   - Replace `clerk.configure(...)` + `await clerk.load()` with `Clerk.configure(...)`.
   - Inject the shared instance with `.environment(Clerk.shared)` and read it via `@Environment(Clerk.self)`.
   - Update auth flows to use `clerk.auth`.

---

## Sitemap

[Overview of all docs pages](https://clerk.com/docs/llms.txt)
