1) Create a Convex + Next.js app
First, initialize a new Convex + Next.js app:Terminal
npx convex dev to start the Convex backend, and npm run dev to start the development server.
2) Install Hexclave
Next, open your app directory and follow the Hexclave setup prompt. Choose Next.js and Convex in the setup builder, then copy the generated prompt into your coding agent.3) Create a Hexclave project
Create a new Hexclave project. Get the project ID & API key environment variables from the dashboard.- Set the
.env.localfile to the environment variables. - In Convex, go to the dashboard of your project’s deployment, and also set the environment variables there.
4) Update code
Next, update or create a file inconvex/auth.config.ts: