convex-setup-auth

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

Updated May 28, 2026
One-click install
npx skills add https://github.com/mrisoli/pokerhouse --skill convex-setup-auth-mrisoli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/mrisoli/pokerhouse/tree/main/packages/backend/.agents/skills/convex-setup-auth
Command: npx skills add https://github.com/mrisoli/pokerhouse --skill convex-setup-auth-mrisoli

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 access control, and getting any of these steps wrong leaves apps with broken logins or unprotected functions. This Skill guides the full setup so Convex correctly validates authenticated sessions. ## Core Features & Use Cases - Provider Selection and Setup: Supports Convex Auth, Clerk, WorkOS AuthKit, Auth0, and custom JWT providers, with per-provider reference workflows covering installation, convex/auth.config.ts, and client provider wiring. - Protected Backend Functions: Implements server-side identity checks using ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus authorization checks for ownership and roles. - Validation and Production Readiness: Verifies login flows, authenticated Convex state, environment variables, and production deployment configuration. - Use Case: A developer adding login to a TanStack Start app backed by Convex can use this Skill to pick Clerk, wire ConvexProviderWithClerk, configure the issuer domain, and confirm protected queries return data only after sign-in. ## Quick Start Set up authentication for my Convex app, help me choose the right auth provider, and wire up protected backend 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?▼

Choose an auth provider first, such as Convex Auth, Clerk, WorkOS AuthKit, or Auth0, then configure convex/auth.config.ts, wrap the client with the matching provider, and set environment variables. Verify that Convex reports the user as authenticated after login before calling setup complete.

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. 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, 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 adding a parallel users table plus storeUser flow is unnecessary. 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's Convex setup page. After activating it, sign out completely and sign back in, because an old Clerk session can keep using a token Convex rejects.

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

Skip it when the backend is not Convex, when you only need pure OAuth/OIDC documentation without a Convex implementation, or when the provider is already fully configured and you only need a one-line fix.