This template provides a minimal setup to get Convex working with Next.js. It uses Clerk for user authentication, Tailwind CSS for styling, and shadcn/ui for UI components.
pnpm create convex@latest -t nextjs-clerk-shadcn
Then:
CLERK_JWT_ISSUER_DOMAIN
to your dev deployment environment variable settings on the Convex dashboard (see docs)NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="<your publishable key>"
to the .env.local
file in this directory.If you want to sync Clerk user data via webhooks, check out this example repo.
pnpm run dev
convex/
: Convex backend functions and schemaapp/
: Next.js application codecomponents/
: Reusable React componentsconvex/myFunctions.ts
: Implement your Convex backend functionsapp/page.tsx
: Main application pageStart by editing convex/myFunctions.ts
to implement your backend logic, and modify app/page.tsx
to update the frontend UI.
If you want to sync Clerk user data via webhooks, check out this example repo.
This project is open-source and available under the MIT License.