convex-setup-auth

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

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/JuanQuenga/statsconnect --skill convex-setup-auth-juanquenga
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/JuanQuenga/statsconnect/tree/main/apps/clashcrown/.agents/skills/convex-setup-auth
Command: npx skills add https://github.com/JuanQuenga/statsconnect --skill convex-setup-auth-juanquenga

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up authentication in a Convex app involves choosing a provider, wiring backend config, client providers, environment variables, and protected functions, and getting any step wrong leaves apps silently unauthenticated. This Skill guides the full setup so login actually works end to end with Convex. ## Core Features & Use Cases - Provider Selection Guidance: Detects or asks which auth provider to use among Convex Auth, Clerk, WorkOS AuthKit, Auth0, or a custom JWT provider before writing any code. - Provider-Specific References: Ships detailed reference files for each provider covering concrete steps, expected files, environment variables, gotchas, and validation checks. - Secure Backend Patterns: Enforces server-side identity verification with ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus authorization checks where needed. - Use Case: A developer adding login to a new Convex app can follow the guided workflow to pick Clerk, configure convex/auth.config.ts, wrap the app in ClerkProvider and ConvexProviderWithClerk, and verify protected queries succeed after sign-in. ## Quick Start Set up authentication for this Convex app by first determining which auth provider fits, then wiring the backend config, client provider, and protected functions.

Frequently Asked Questions about convex-setup-auth

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

FAQPage Schema
How do I set up authentication in a Convex app?▼

First choose an auth provider such as Convex Auth, Clerk, WorkOS AuthKit, or Auth0, then configure convex/auth.config.ts, set environment variables, and wrap the client with the matching provider. Verify login works and that Convex recognizes the authenticated session before finishing.

Which auth provider should I use with Convex?▼

Convex Auth is a good 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. Check the repo for existing provider dependencies before deciding.

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

Call ctx.auth.getUserIdentity() inside the function and throw an error if it returns null, then look up the user by 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 adding a parallel users table plus storeUser flow is unnecessary. Only add app-level user storage when the app genuinely needs first-class user documents.

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 in the Clerk dashboard, then sign out completely and sign back in so a fresh token is issued.

When should I not use this Convex auth setup workflow?▼

Skip it for non-Convex backends, pure OAuth documentation without a Convex implementation, or when the provider is already fully configured and only a one-line fix is needed.