convex-setup-auth

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

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/alex-jordan547/agent-setup --skill convex-setup-auth-alex-jordan547
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/alex-jordan547/agent-setup/tree/main/archive/convex-setup-auth
Command: npx skills add https://github.com/alex-jordan547/agent-setup --skill convex-setup-auth-alex-jordan547

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding authentication to a Convex app involves choosing between multiple providers (Convex Auth, Clerk, WorkOS AuthKit, Auth0, custom JWT), wiring auth.config.ts, protecting backend functions, and deciding whether a users table is needed. This Skill guides that entire setup so login, identity mapping, and authorization work correctly on both local and production deployments. ## Core Features & Use Cases - Provider Selection & Setup: Detects or asks which auth provider to use, then follows provider-specific reference guides for Convex Auth, Clerk, WorkOS AuthKit, or Auth0. - Backend Protection: Implements server-side identity checks with ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus role- or ownership-based authorization where needed. - Validation & Production Readiness: Verifies sign-in flows, environment variables, callback URLs, and production configuration before declaring setup complete. - Use Case: A user says "add auth to my Convex app." The Skill identifies the repo already uses Clerk, reads the Clerk reference, configures auth.config.ts with the issuer domain, wraps the app in ClerkProvider and ConvexProviderWithClerk, and verifies protected queries return data after login. ## Quick Start Set up authentication for this Convex app, figure out the right provider, and protect my queries and mutations with login checks.

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?

First choose a provider: Convex Auth, Clerk, WorkOS AuthKit, Auth0, or a custom JWT provider. Then configure convex/auth.config.ts, wire the client provider (such as ConvexProviderWithClerk), and protect backend functions with ctx.auth.getUserIdentity() checks.

Convex Auth vs Clerk vs WorkOS AuthKit, which should I use?

Use Convex Auth when you want auth handled directly inside Convex. Choose Clerk or Auth0 when the app already uses them, and WorkOS AuthKit when you want AuthKit specifically or a Convex-managed WorkOS team. The Skill asks before assuming a provider.

How do I protect Convex queries and mutations with auth?

Call ctx.auth.getUserIdentity() inside the function handler and throw an error when it returns null, instead of trusting a client-provided userId. Look up the user via the tokenIdentifier index and add ownership or role checks where the app needs them.

Why does Convex report unauthenticated after Clerk login works?

This usually means the Clerk Convex integration was not activated or auth.config.ts was not synced. Activate the integration at the Clerk dashboard, sign out fully and sign back in, then run the Convex dev or deploy flow so the backend picks up the new config.

Does every Convex app need a users table for authentication?

No. If the app only needs authentication gates, ctx.auth.getUserIdentity() is enough. Only add a users table and storeUser flow when the app needs first-class user records, and never add a parallel users table for Convex Auth, which manages user records internally.

When should I not use this Convex auth setup approach?

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