#guide for convex auth

3 messages · Page 1 of 1 (latest)

atomic latch
#

what's the best and quickest guide available to start using convex auth with nextjs

brave sonnetBOT
#

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:

  1. First, create a new project using the Convex CLI:
npm create convex@latest

Choose "Next.js" and then "Convex Auth" when prompted.

  1. 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.0
    

    b. Run the initialization command:

    npx @convex-dev/auth
    

    c. 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.

  2. 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.

Convex Auth documentation (https://docs.convex.dev/auth/convex-auth) provides more information about the current state and capabilities of Convex Auth.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: