> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leap.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication using Clerk

> A step by step guide for implementing user authentication.

Leap recommends using [Clerk](https://clerk.com) for user authentication, it's a scalable and enterprise-ready authentication solution that comes with a generous free tier.

Leap has an integration with Clerk, which handles all the implementation steps to set up user authentication for your app. Here's how you use it.

**1. Prompt Leap**

Once you've created your app and are ready to add user authentication, paste this prompt in the chat box and send:

```
Implement authentication using Clerk
```

Leap will now implement the auth flow using Clerk and set up all the required public and secret keys.

**2. Create a Clerk account and claim your app**

* Once Leap has finished, you will see a new **Users** page in Leap's top navigation, open it.
* Here you will see a message instructing you to **claim your application**, click the link to go to Clerk's website where you can create an account and then claim your app.
* Once you've done this, you're app is all set with user authentication for the Preview and any Staging environments you create.

## Best practices before releasing your app

**Verify the code that Leap generated**

Authentication is an important part of your application. We recommend always spending some time verifying that the implementation is correct. Ask a developer colleague or friend if you need help.

* You can ask Leap to point you to files to review, open them and confirm:
  * A top-level provider or wrapper for Clerk on the client.
  * Server routes or middleware that verify the session using the secret key.
  * Example protected routes that check for a signed-in user.

**Test the full auth flow**

* In your running app, click **Sign up** or **Sign in** and complete the flow.
* Visit a protected page to confirm redirect and access rules.

**Production readiness**

* When Leap sets up the Clerk integration, it uses Clerk's development instance. This is Clerk's default for development and staging environments.
* Before releasing your app to the public, Clerk recommends creating a Production instance. [Learn more in Clerk's production readiness guide](https://clerk.com/docs/guides/development/deployment/production)

## Getting help

If you need assistance, join our [Discord](https://leap.new/discord) and we will help you get unblocked.
