This repository is a guided getting started example for Neon Authorize + Clerk.
- Create a Neon project
- Create a Clerk Application
- Head to the Clerk dashboard, and find "JWT Templates"
- Create a JWT Template ("Blank") and give it any name (e.g., "my-jwt-template")
- Copy the "JWKS Endpoint" URL and save it for later
- Head to the Neon Console, and find "Authorize"
- Inside Authorize, click "Add Authentication Provider", paste in the JWKS Endpoint URL you copied earlier, and submit
- Follow the steps in the UI to setup the roles for Neon Authorize. You should ignore the schema related steps if you're following this guide
- Clone this repository and run
npm install
orbun install
- Create a
.env
file in the root of this project and add the following:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
# For the `neondb_owner` role.
DATABASE_URL=
# For the `authenticated`, passwordless role.
DATABASE_AUTHENTICATED_URL=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
- Run
npm run drizzle:migrate
orbun run drizzle:migrate
to apply the migrations - Run
npm run dev
orbun run dev
- Open your browser and go to
http://localhost:3000
- Login and play around!