convex-setup-auth

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

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/hpark0011/mirror --skill convex-setup-auth-hpark0011
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/hpark0011/mirror/tree/main/.agents/skills/convex-setup-auth
Command: npx skills add https://github.com/hpark0011/mirror --skill convex-setup-auth-hpark0011

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 of these wrong leaves the app insecure or broken. This Skill guides the full setup so login works and Convex actually validates the authenticated session. ## Core Features & Use Cases - Provider Selection and Setup: Supports Convex Auth, Clerk, WorkOS AuthKit, Auth0, and custom JWT providers, with per-provider reference files covering concrete steps, env vars, and gotchas. - Protected Backend Functions: Implements server-side identity checks with ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus authorization checks for ownership, roles, or team access. - Validation and Production Readiness: Verifies sign-in flows, authenticated Convex state, and production configuration when requested. - Use Case: You are building a React app on Convex and need login. The Skill detects or asks for your provider, configures convex/auth.config.ts, wraps the app with the correct provider components, and confirms protected queries return data only for authenticated users. ## Quick Start Set up authentication for this Convex app by first determining which auth provider to use, 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 component. Verify that Convex reports the user as authenticated after login, not just that the provider login succeeds.

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 auth features. Custom JWT providers fit existing auth systems not covered above.

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, rather than trusting a client-provided userId. Look up the user by the identity's tokenIdentifier and add authorization checks for ownership or roles where the app needs them.

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 if the app genuinely needs first-class user documents in Convex.

Why does Convex say no auth provider matched the token with Clerk?▼

This usually means the Clerk Convex integration was not activated at the Clerk dashboard setup page, or the session predates activation. Activate the integration, then sign out completely and sign back in before retesting.

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

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