convex-setup-auth

Configures Convex authentication with provider wiring, identity mapping, and access control.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/Noisemaker111/unofficialmarathon --skill convex-setup-auth-noisemaker111
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/Noisemaker111/unofficialmarathon/tree/main/packages/backend/.crush/skills/convex-setup-auth
Command: npx skills add https://github.com/Noisemaker111/unofficialmarathon --skill convex-setup-auth-noisemaker111

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding login and signup to a Convex app involves choosing an auth provider, wiring auth.config.ts, protecting backend functions, and mapping user identities, and getting any step wrong leaves the app unauthenticated or insecure. ## Core Features & Use Cases - Provider Selection Guidance: Detects or asks which provider to use among Convex Auth, Clerk, WorkOS AuthKit, Auth0, or a custom JWT provider before writing setup code. - Provider-Specific References: Ships detailed reference files for each provider covering env vars, auth.config.ts, client provider wiring, gotchas, and validation steps. - Backend Protection Patterns: Shows how to protect queries and mutations with ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus role-based access control where needed. - Use Case: A developer says "add auth to my Convex app" and the skill walks through picking Clerk, configuring the issuer domain, wrapping the app in ClerkProvider and ConvexProviderWithClerk, and verifying authenticated queries work. ## Quick Start Set up authentication for this Convex app, figure out the right provider first, then wire up login, protected queries, and user identity mapping.

Frequently Asked Questions about convex-setup-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add authentication to a Convex app?▼

Choose an auth provider first, such as Convex Auth, Clerk, WorkOS AuthKit, or Auth0, then configure convex/auth.config.ts, wrap the client in the matching provider, and protect backend functions with ctx.auth.getUserIdentity(). The skill reads the matching provider reference file and official docs for exact steps.

Which auth provider should I use with Convex?▼

Convex Auth is the default when you want auth handled directly in Convex. Use Clerk, WorkOS AuthKit, or Auth0 when the app already uses those platforms or you want their hosted features. The skill checks repo dependencies and existing config before asking you to choose.

How do I protect Convex queries and mutations with auth?▼

Call ctx.auth.getUserIdentity() inside the handler and throw an error when it returns null, then look up the user by identity.tokenIdentifier. Never trust a client-provided userId argument, since clients can send arbitrary values.

Does Convex Auth require a users table?▼

No. Convex Auth manages user records internally through its built-in auth tables, so you should not add a parallel users table plus storeUser flow. Only add app-level user storage when the app genuinely needs first-class user documents in Convex.

Why does Convex report unauthenticated after Clerk login?▼

This usually means the Clerk Convex integration was not activated or the session predates activation. Activate the integration at the Clerk dashboard Convex setup page, then sign out completely and sign back in so a fresh token is issued.

Can I set up Convex auth for production as well as local dev?▼

Yes. The skill asks whether you want local-only or production-ready setup, then covers production environment variables, redirect URLs, and deployment config for the chosen provider. Dev and prod credentials are kept separate.