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

# Clerk integration

> Learn how to integrate Clerk with your Lovable application

## Why Clerk?

![What Is Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/what-is-clerk.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=fbdaff4ce1fd8ffdc791bc1a9306a37f)

[Clerk](https://clerk.com) handles authentication and user management so you don’t have to build it from scratch. With just a few prompts and config steps, you get:

* Secure sign-in & sign-up (social, password, MFA)
* Prebuilt UI components: user profiles, org management, impersonation
* Support for B2B apps (teams, roles, invitations)
* Integration with Supabase, Stripe (coming soon), and more
* Waitlist mode to manage early access
* Generous free tier: 10K MAUs

## Step-by-step integration guide

[YouTube video player](https://www.youtube.com/embed/tyAsNwu_xCI?si=VHCGf2IlFRQzVLeD)

Here is a step-by-step guide:

**1. Set Up Your Clerk App**

**1. Step 1**

Create a Clerk Account → [Clerk.com](https://clerk.com)

**2. Step 2**

In the Clerk dashboard, create a new app

**1. Step 1**

Sign in to Clerk & create a new app

![Create Clerk Application Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/create-clerk-application.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=3eb11dfb0f3f85b0b6b6b49bb14b9add)

**2. Step 2**

Enable desired authentication providers (e.g. Google, GitHub)

**3. Step 3**

Enable “Waitlist” under **Configure > Restrictions**

![Clerk Waitlist Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-waitlist.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=0dbc9a96b783c89dea49cc40e6c26baf)

**4. Step 4**

Copy your **Public API Key**

![Clerk Api Key Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-api-key.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=4b100e07e88809bfebdc636c799d445a)

**3. Step 3**

**Add Clerk to Your Lovable App**

**1. Step 1**

In **Lovable**, add Clerk as your authentication provider.

Prompt Lovable:

> [!NOTE]
>
> Let's build a beautiful project and task management app in the style of Asana. Users should be able to login and signup using Clerk for authentication and user management. Let's start by building a great looking homepage and use Clerk's waitlist component to let users join while we build the rest of the app.

![Asana Clone Lovable Pn](https://mintcdn.com/generaltranslation-d8a08cd1/At48MABj-G93zw7Y/images/asana-clone-lovable.png?fit=max\&auto=format\&n=At48MABj-G93zw7Y\&q=85\&s=779eedc11c2ad10d0fa6151f937e31ac)

**2. Step 2**

Paste your **Public API Key** when asked

**3. Step 3**

Lovable scaffolds the login and sign-up pages

![Waitlist Component Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/waitlist-component-clerk.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=76350e4c4aabb03f8d73ada79c99c6c4)

**4. Step 4**

Deploy & test — you’re now using Clerk Auth

**2. Activate Waitlist Mode (Optional)**

> [!NOTE]
>
> **Why use a waitlist?** – Gather early users before launching your app!

Use Clerk’s built-in waitlist to collect users pre-launch.

**1. Step 1**

In Clerk dashboard: **Configure > Restrictions > Waitlist**

**2. Step 2**

New sign-ups will show as **pending**

**3. Step 3**

* Users who sign up will now be **pending approval**
* Admins can approve users from the Clerk dashboard

  ![Clerk Waitlist Pending Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-waitlist-pending.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=b1cb4e017c6696f2170d48e643819c37)

**4. Step 4 (Bonus)**

Customize waitlist emails (branding, content)

![Clerk Email Templates Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-email-templates.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=5283305d887e73b091f90f38de79222c)

![Sms Code Verification Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/sms-code-verification.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=c8864119b5019a606848a5ec3314f35f)

**3. Managing Users & Teams in Clerk**

Set up team-based access in your app.

**1. Step 1**

In Clerk dashboard: enable **Organizations**

![Organization Management Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/organization-management-clerk.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=dee1358df6209650a4e64f09270f9075)

**2. Step 2**

Define roles (Admin, Member, Viewer, etc.)

**3. Step 3**

Invite users to your org by email

**4. Step 4**

Assign roles and permissions via dashboard

**5. Step 5**

Prompt Lovable to:

> [!NOTE]
>
> Ask users to create/join an organization after sign-up

![Clerk Organization Create Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-organization-create.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=d73b6ac4b451427dd6d5745679331f59)

> [!NOTE]
>
> **Using Clerk’s User Profile Component**
>
> * Provides a prebuilt user management dashboard
> * Supports social logins & password authentication
> * Users can manage their own accounts & 2FA
>
>   ![Clerk Organization Members Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/clerk-organization-members.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=219f9a2976ea8de50adce5d6beb0e779)

**4. Impersonation Mode (For Admins)**

> [!TIP]
>
> **What is Impersonation Mode?**
>
> Admins can log in as any user to troubleshoot issues

Troubleshoot your app as if you were a specific user.

**1. Step 1**

In Clerk dashboard > Users, click on a user

**2. Step 2**

Click **Impersonate**

**3. Step 3**

View your app from their perspective

**4. Step 4**

Security: impersonators can’t perform sensitive actions (e.g. change password)

**5. Integrate with Supabase (Advanced)**

Combine Clerk Auth with Supabase backend.

![Supabase Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/supabase-clerk.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=099ac332afdc631e19a074357aa1d909)

> [!NOTE]
>
> **Why integrate with Supabase?**
>
> * Store user data in a database
> * Secure authentication with JWT tokens
> * Connect authentication to app features

**How to integrate:**

**1. Step 1**

In Supabase, go to **Settings > API > JWT Secret (**[**documentation**](https://clerk.com/docs/integrations/databases/supabase)**)**

![Supabase Clerk Integration Doc Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/supabase-clerk-integration-doc.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=4c1b798ebc7906a678616e2c56048bb2)

![Sql Editor Supabase Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/sql-editor-supabase.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=639f9464df1fbf406c91d6fd2d408bd8)

**2. Step 2**

In Clerk: **JWT Templates > Add Supabase**, paste JWT secret

![Supabase Api Key Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/At48MABj-G93zw7Y/images/Supabase-api-key-clerk.png?fit=max\&auto=format\&n=At48MABj-G93zw7Y\&q=85\&s=6ffb7d603fffe943419234209130d04e)

![Jwt Template Clerk Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/jwt-template-clerk.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=5be5b5dd4b216455362ab2b6c8e5542a)

![Jwt Template Clerk Configuration Pn](https://mintcdn.com/generaltranslation-d8a08cd1/CqzNmr5z5kHJD2HH/images/jwt-template-clerk-configuration.png?fit=max\&auto=format\&n=CqzNmr5z5kHJD2HH\&q=85\&s=f0364188f00ba2f836cee7cf5b46282f)

**3. Step 3**

Enable **Clerk as an authentication provider**

Update RLS policies to use `auth.uid()` from Clerk

Prompt Lovable to:

> [!NOTE]
>
> Let's setup supabase to integrate with Clerk. Clerk has been configured with a Supabase secret. Here's an example of implementing the supabase client using Clerk. Use this as a reference.
>
> *\[Supabase client configuration import]*

**4. Step 4**

Confirm Clerk-issued tokens are accepted by Supabase

![Supabase Tasks Table Pn](https://mintcdn.com/generaltranslation-d8a08cd1/jw-DadLCPO99GETa/images/supabase-tasks-table.png?fit=max\&auto=format\&n=jw-DadLCPO99GETa\&q=85\&s=161f00d83acbb33f24220fbd3ccff779)

**6. Add a Custom Domain (Optional)**

> [!NOTE]
>
> **Why use a custom domain?**
>
> Boosts brand recognition & trust
>
> [More information here](https://docs.lovable.dev/tips-tricks/custom-domain).

**1. Step 1**

In Lovable: **Project > Settings > Custom Domain**

**2. Step 2**

Enter your purchased domain (e.g. `app.yourcompany.com`)

**3. Step 3**

Lovable auto-configures DNS (no need to leave Lovable)

**4. Step 4**

Deploy & test your app with the new domain.

**5. Step 5**

Done ✅ — your app is now white-labeled

**7. Final Thoughts & Next Steps**

**Your app now has:**

* Secure authentication with Clerk
* A waitlist to collect early users
* User & team management features
* Supabase database integration
* A professional custom domain

## Bonus: Build B2B features in minutes

Clerk supports:

* Role-based access for organizations
* Invite flows (email-based, pre-built UI)
* Organization profile customization (logo, name)
* Multi-org switching (e.g. Slack-style)

**Ask Lovable to:**

> [!NOTE]
>
> Add organization switcher UI

> [!NOTE]
>
> Let users invite teammates

## Tips & troubleshooting

* **Already using Supabase Auth?** You can switch to Clerk without rewriting your app logic. Just configure JWT correctly and swap auth provider.
* **Email customization:** Clerk lets you edit all transactional email templates (waitlist, invitations, approvals).
* **Mobile login**: Clerk supports passkeys, OTP, and SMS — no extra config needed in Dev Mode.
* **Compliance**: Clerk is SOC2, HIPAA, and GDPR compliant.

## Frequently Asked Questions (FAQ)

> [accordion] Can I switch from Supabase Auth to Clerk easily?
>
> Yes. Clerk and Supabase work well together. You just need to:
>
> * Set up Clerk to issue JWTs
> * Add Supabase’s JWT secret in Clerk
> * Update Supabase RLS policies to use Clerk’s `auth.uid()`
>
> This lets you plug Clerk into an existing Supabase-backed app with minimal changes.

> [accordion] Do I need to configure OAuth providers like Google or GitHub?
>
> Only for production. In development mode, Clerk provides shared credentials for testing. For production:
>
> * Set up your own Google/GitHub/etc. credentials
> * Add them in Clerk under **OAuth settings**

> [accordion] What’s the difference between Organizations and Users?
>
> * **Users**: Individuals who can log in to your app
> * **Organizations**: Groups of users (teams, companies)
>
> Use organizations when you want:
>
> * Role-based access (Admin, Member, etc.)
> * Users to invite teammates
> * B2B SaaS-style flows

> [accordion] What is “Impersonation Mode”?
>
> It allows admins to log in as any user — super helpful for:
>
> * Debugging user issues
>
> * Understanding their experience
>
> * Providing live support
>
> > [!NOTE]
> >
> > Clerk limits what impersonators can do (e.g., no password changes).

> [accordion] Can I customize Clerk's UI components?
>
> Yes. Clerk offers:
>
> * Full CSS support via `appearance` props
> * The option to build fully custom UIs using Clerk React hooks
>
> You can keep the out-of-the-box look or fully match your app’s brand.

> [accordion] Can I email my waitlist users from Clerk?
>
> Currently:
>
> * Users are auto-notified when approved from the waitlist
> * Bulk email support is **coming soon**
>
> For now, export emails and use your preferred email tool.

> [accordion] Is Clerk free to use?
>
> Yes! Clerk has a generous free tier:
>
> * Up to **10,000 Monthly Active Users (MAUs)**
> * Paid plans start at **\$25/month**, with usage-based pricing after
>
> You can use it in production without paying until you scale.

> [accordion] Does Clerk support compliance (SOC2, HIPAA, GDPR)?
>
> Yes. Clerk is:
>
> * **SOC 2 certified**
> * **HIPAA-compliant**
> * **GDPR-ready**
>
> Ideal for teams building in regulated industries.

> [accordion] Can I use Clerk with Stripe for billing?
>
> Coming soon. You’ll soon be able to:
>
> * Define plans (e.g. Free, Pro, Enterprise)
> * Let users/orgs manage subscriptions from Clerk’s UI
> * Automatically sync data to Stripe
>
> Follow [@clerkdev](https://x.com/clerkdev?lang=en) on X for updates.

Want a question added to this FAQ? [Let us know on Discord](https://discord.gg/lovable-dev)!

## Final thoughts

Clerk turns authentication into a prompt. You don’t need to build it yourself.

**With just a few clicks and prompts, your app now has:**

* Secure, scalable authentication
* Team & organization management
* Impersonation tools for debugging
* Supabase-backed data and access control
* Custom domain support for a polished UX


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.