Clerk Next.js Starter

This example shows how to use Clerk with Next.js. The example Next.js application features adding sign up, sign in, profile management, and an authenticated API route.

chat on Discord documentation twitter


Clerk is Hiring!

Would you like to work on Open Source software and help maintain this repository? Apply today!


Demo

A hosted demo of this example is available at clerk-nextjs-example.vercel.app

Deploy your own

Deploy the example directly from GitHub using Vercel:

Deploy with Vercel

Running the starter

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example https://github.com/clerkinc/clerk-nextjs-starter
# or
yarn create next-app --example https://github.com/clerkinc/clerk-nextjs-starter

To run the example locally you need to:

  1. Sign up for a Clerk account at https://clerk.dev.
  2. Go to Clerk's dashboard and create an application.
  3. Set the required Clerk environment variables as shown in the example env file.
  4. npm install the required dependencies.
  5. npm run dev to launch the development server.

Learn more

To learn more about Clerk and Next.js, check out the following resources:

Contact

If you need support or have anything you would like to ask, please reach out in our Discord channel. We'd love to chat!