#auth config
3 messages · Page 1 of 1 (latest)
Hi @onyx helm. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To integrate Convex with Clerk in a Next.js app, your auth.config.ts (or auth.config.js if you're using JavaScript) file should look like this:
import { AuthConfig } from "convex/server";
export default {
providers: [
{
// Use your Clerk Issuer URL from your "convex" JWT template,
// or reference it via an environment variable.
// Make sure to set CLERK_JWT_ISSUER_DOMAIN in your Convex dashboard.
domain: process.env.CLERK_JWT_ISSUER_DOMAIN!,
applicationID: "convex",
},
]
} satisfies AuthConfig;
Key points:
- The
domainshould be set to your Clerk Frontend API URL (the issuer domain from your Clerk JWT template). It's best practice to use an environment variable likeCLERK_JWT_ISSUER_DOMAINfor this. - The
applicationIDshould be"convex". - Make sure to set the
CLERK_JWT_ISSUER_DOMAINenvironment variable in your Convex dashboard for both development and production environments. - You do not need to include a
typefield in the provider object—doing so may cause errors as discussed in support threads.