Skip to content

clerk/clerk-android

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 twitter


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

Add the Clerk Android SDK to your app's build.gradle(.kts)

dependencies {
    implementation("com.clerk:clerk-android:0.1.4")
}

💡 Tip: Check Maven Central for the latest version.

Initialization

Before using any part of the SDK, you must call Clerk.initialize() in your Application class with your publishable key and application context:

import com.clerk.Clerk

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        Clerk.initialize(
            context = this,
            publishableKey = "pk_test_..." // Your publishable key from Clerk Dashboard
        )
    }
}

Don't forget to register your Application class in AndroidManifest.xml:

<application
    android:name=".YourApplication" 
    android:theme="@style/AppTheme">
    <!-- ... -->
</application>

Initialize with custom options

import com.clerk.Clerk

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        Clerk.initialize(
            context = this,
            publishableKey = "pk_test_..." // Your publishable key from Clerk Dashboard,
            options = ClerkConfigurationOptions(enableDebugMode = true),
        )
    }
}

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.

Documentation

📝 License

This project is licensed under the MIT license.

See LICENSE for more information.

About

Android SDK for Clerk

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •