Skip to main content

Set up iOS, macOS, and Android apps with clerk init

Category
Product
Published

clerk init now sets up Clerk in Xcode and Android projects, or creates a new app with Clerk already set up.

The Clerk CLI now sets up native apps. Run clerk init in an Xcode or Android project, and it links your Clerk application, registers your app, and adds the Clerk SDK.

What's new

  • Existing apps. Run clerk init from the folder with your Xcode project, or from your Android project's root. In an Xcode project, it installs the Clerk iOS SDK with Swift Package Manager. In an Android project, it adds the Clerk Android SDK to your Gradle build and initializes Clerk in your Application class.
  • New apps. clerk init --starter with --framework ios, --framework macos, or --framework android creates a SwiftUI or Jetpack Compose app with Clerk set up. Add --prebuilt-auth-ui to include Clerk's prebuilt sign-in screen.
  • Native sign-in. --sign-in-with-apple turns on native Sign in with Apple. --sign-in-with-google turns on native Sign in with Google for Android and lists the Google Cloud steps the CLI can't do for you.
  • clerk doctor. Run it to check your iOS, macOS, or Android setup.
  • Agent mode. Agents can run setup with --mode agent --json. The iOS and Android quickstarts include a prompt you can give your agent.

iOS and macOS setup needs Xcode on a Mac. Android setup works on macOS, Linux, and Windows.

Get started

Use clerk 4.4.0 or later:

npx -y clerk@latest init

Then follow the iOS quickstart or the Android quickstart, or see the Clerk CLI docs.

Contributors
Sean Perez
Sam Wolfand

Share this article