Skip to content

About

Android SDK for Clerk

Resources

Security policy

Stars

18 stars

Watchers

4 watching

Forks

Repository files navigation


Official Clerk Android SDK

Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile.

chat on Discord documentation Follow on X


Usage

Creating a Clerk Application

  1. Sign up for an account
  2. Create an application in your Clerk dashboard
  3. Copy your Publishable Key from the API Keys section

Installation

The Clerk Android SDK is available as two separate artifacts:

  • clerk-android-api – Core API and authentication logic (required)
  • clerk-android-ui – Prebuilt Jetpack Compose UI components (optional, includes API)

Add the desired artifact to your app's build.gradle(.kts):

API Only

Use this if you want to build your own custom UI:

dependencies {
    implementation("com.clerk:clerk-android-api:<latest-version>")
}

With Prebuilt UI Components

Use this if you want to use the prebuilt Jetpack Compose UI components:

dependencies {
    implementation("com.clerk:clerk-android-ui:<latest-version>")
}

💡 Tip: Check Maven Central for the latest versions: clerk-android-api | clerk-android-ui

Samples

Quickstart

samples/quickstart: This is a paired repo with the Android Quickstart guide. It provides a simple example of how to integrate Clerk into an Android application, demonstrating user sign-up, sign-in, and profile management. See the README for more info

Custom flows

samples/custom-flows: This is a paired repo with the Custom Flows guide. It showcases how to implement custom authentication flows using Clerk, including advanced scenarios like multi-factor authentication and reset password. See the README for more info

Linear Clone

samples/linear-clone: This is an example that shows how you might integrate with compose navigation, it is a native recreation of the Linear auth flow (which is web based) and includes Sign in with Google, Passkey authentication, Sign out, and Email Code Authentication. See the README for more info.

Prebuilt UI

samples/prebuilt-ui: This is an example that shows how to integrate the Clerk prebuilt UI components. See the README for more info.

Documentation

Developing this SDK

The build runs on JDK 21 (Robolectric, Paparazzi and the Paparazzi Gradle plugin require it). gradle/gradle-daemon-jvm.properties makes Gradle and Android Studio pick a local JDK 21 even when JAVA_HOME points elsewhere. Published bytecode still targets Java 17 (jvmTarget in gradle/libs.versions.toml).

Run ./bootstrap.sh once (it also works from a git worktree) to install the pre-commit hook that formats and checks staged files. Re-run it when config/git/hooks/pre-commit changes.

CI runs these on every pull request, and the release workflow runs them before publishing:

./gradlew :source:api:testDebugUnitTest :source:ui:testDebugUnitTest :source:telemetry:testDebugUnitTest
./gradlew spotlessCheck   # ./gradlew spotlessApply to fix
./gradlew detekt :source:api:detektDebug :source:ui:detektDebug :source:telemetry:detektDebug
./gradlew :source:api:lint :source:ui:lint :source:telemetry:lint
./gradlew verifyPublishedArtifacts

The hook runs ktfmt, detekt and sort-dependencies from jars it downloads at the versions in gradle/libs.versions.toml and checks against config/bin/tool-checksums.sha256. After changing one of those versions, run ./gradlew downloadToolJars to pin the new jars, or ./gradlew updateToolJars to move all three to their latest releases.

To find dependencies a module declares but doesn't use, run ./gradlew buildHealth (the Dependency Analysis plugin). ./gradlew rakeDependencies removes the unused ones, and declares any used dependency that only a removed one provided; add --preview to see the changes first. Build and run the tests afterwards: the analysis only sees what compiles against what, not what a test needs at runtime. The rake-dependencies.yml workflow runs the rake on main every night and opens a pull request from automation/rake-dependencies when it finds something.

License

This project is licensed under the MIT license.

See LICENSE for more information.

About

Android SDK for Clerk

Resources

Security policy

Stars

18 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages