#guide for convex auth
3 messages · Page 1 of 1 (latest)
Hi @atomic latch. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To get started with Convex Auth in a Next.js application, the quickest and most straightforward guide available is the Convex Auth setup guide. Here's a summary of the steps:
- First, create a new project using the Convex CLI:
npm create convex@latest
Choose "Next.js" and then "Convex Auth" when prompted.
-
If you already have an existing project, you can add Convex Auth by following these steps:
a. Install the necessary packages:
npm install @convex-dev/auth @auth/core@0.36.0b. Run the initialization command:
npx @convex-dev/authc. Update your schema to include authentication tables:
import { defineSchema } from "convex/server"; import { authTables } from "@convex-dev/auth/server"; const schema = defineSchema({ ...authTables, // Your other tables... }); export default schema;d. Set up the React provider in your Next.js app.
-
After the initial setup, you'll need to configure authentication methods according to your needs.
For more detailed instructions and next steps, you can refer to the Convex Auth setup guide (https://labs.convex.dev/auth/setup).
It's important to note that Convex Auth is currently in beta, and support for Next.js server components, API routes, middleware, and SSR is under active development. If you need these features, you might want to consider alternative authentication solutions or wait for full Next.js support.