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

# Clerk for authentication

> Connect Clerk Auth to Same.new to add secure login, signup, and sessions to your project. Set up in minutes.

## What is Clerk?

[Clerk](https://clerk.com/) is a complete **user management** solution for modern web applications. It provides **authentication**, **user profiles**, **session management**, and **access control**. Clerk can be easily integrated to simplify building user-centric apps.

When you connect Same with Clerk, you can use natural language to:

* Set up authentication flows and UI for sign-up and login
* Manage user sessions, roles, and permissions
* Retrieve and update user profile data directly within your project

## Get started with Clerk

We recommend connecting to Clerk through MCP

<Steps>
  <Step title="Open MCP tools panel">
    Click **Tools** and open the panel.

    <Frame>
      <img src="https://mintcdn.com/same/6v_Kyyhq-0v66NVR/images/tools-entry.png?fit=max&auto=format&n=6v_Kyyhq-0v66NVR&q=85&s=b234a87c5c51f1081c24994b15e2a2ee" width="2112" height="1422" data-path="images/tools-entry.png" />
    </Frame>
  </Step>

  <Step title="Connect to Clerk MCP">
    Find the card for Clerk and click **Add Clerk**

    <Frame>
      <img src="https://mintcdn.com/same/6v_Kyyhq-0v66NVR/images/add-clerk.png?fit=max&auto=format&n=6v_Kyyhq-0v66NVR&q=85&s=ee811644b2f58defc16869d6b03b9072" width="1998" height="1260" data-path="images/add-clerk.png" />
    </Frame>
  </Step>

  <Step title="Set up your Clerk account">
    Follow the instructions to create a Clerk application for your project. You may need to sign up for an account if you don't have one yet.

    <Info>
      Clerk provides free plans for new users. [Check Clerk's pricing](https://clerk.com/pricing).
    </Info>
  </Step>

  <Step title="Add Clerk authentication to your project">
    Once the connection is successful, directly ask Same to:

    ```md theme={null}
    Add authentication to my project with Clerk
    ```

    Same will automatically set up the authentication foundation for your project.
  </Step>

  <Step title="Set up your Clerk API keys">
    To fully integrate with Clerk, you need to copy your API keys to your `.env` file. You can directly ask Same for detailed instructions:

    ```
      How to set up my Clerk API keys in my project?
    ```

    <Note>
      Clerk has different keys for test environment (where you are building) and live environment (where your app is published). You can use the test environment keys first, then switch to live environment keys when you deploy. [Learn how to deploy your Clerk app to live environment](https://clerk.com/docs/deployments/overview#api-keys-and-environment-variables)
    </Note>
  </Step>
</Steps>

## Sample prompts with Clerk

Here are some sample prompts you can try with Clerk to discover its full functionality:

<AccordionGroup>
  <Accordion title="Add Clerk authentication to your project">
    ```md theme={null}
    Add authentication to my project with Clerk
    ```
  </Accordion>

  <Accordion title="Design organization authentication for your SaaS app">
    ```md theme={null}
    Design and create a role and permission system for my project with auth
    ```
  </Accordion>
</AccordionGroup>
