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.
Clerk is Hiring!
Would you like to work on Open Source software and help maintain this repository? Apply today!
A hosted demo of this example is available at clerk-nextjs-example.vercel.app
Deploy the example directly from GitHub using Vercel:
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:
- Sign up for a Clerk account at https://clerk.dev.
- Go to Clerk's dashboard and create an application.
- Set the required Clerk environment variables as shown in the example env file.
npm install
the required dependencies.npm run dev
to launch the development server.
To learn more about Clerk and Next.js, check out the following resources:
If you need support or have anything you would like to ask, please reach out in our Discord channel. We'd love to chat!