convex-setup-auth

Configures Convex authentication, identity mapping, and access control across multiple auth providers.

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

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 the app silently unauthenticated. This Skill guides the full setup so Convex actually validates user identity end to end. ## 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 installation, convex/auth.config.ts, environment variables, gotchas, and validation steps. - Secure Backend Patterns: Enforces server-side identity checks with ctx.auth.getUserIdentity() instead of trusting client-provided user IDs, plus authorization checks for ownership and roles. - Use Case: You are building a Next.js app on Convex and need login with Clerk. The Skill detects the framework, configures convex/auth.config.ts with the Clerk issuer domain, wraps the app in ClerkProvider and ConvexProviderWithClerk, and verifies protected queries return authenticated identity. ## Quick Start Set up authentication for my Convex app, figure out the right provider from my repo, and wire up protected functions and login.

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 a 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 that ctx.auth.getUserIdentity() returns an identity in protected functions.

Clerk vs Convex Auth for a Convex app, which should I use?▼

Convex Auth handles auth directly inside Convex and manages user records internally, making it a good default for new apps. Clerk fits when the app already uses Clerk or needs its hosted auth features like prebuilt UI and session management.

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 identity.tokenIdentifier. Never trust a userId passed from the client, since clients can send arbitrary values.

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 to push the backend 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 stored in the Convex database.

Can I use Auth0 with Convex for production apps?▼

Yes, by configuring convex/auth.config.ts with the Auth0 domain and client ID and wrapping the app with Auth0Provider and ConvexProviderWithAuth0. Keep dev and production tenants separate and verify production callback URLs and environment variables independently.