convex-setup-auth

Configure authentication and access control for Convex apps.

Updated Dec 23, 2021
One-click install
npx skills add https://github.com/dvakatsiienko/bytes --skill convex-setup-auth-dvakatsiienko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/dvakatsiienko/bytes/tree/main/apps/x-com-chat/.agents/skills/convex-setup-auth
Command: npx skills add https://github.com/dvakatsiienko/bytes --skill convex-setup-auth-dvakatsiienko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Convex app authentication wiring and access control can be complex, and this Skill provides end-to-end guidance to implement, secure, and manage user identity and permissions across Convex apps.

Core Features & Use Cases

  • Choose and configure an auth provider (Convex Auth, Clerk, WorkOS AuthKit, Auth0, or custom JWT)
  • Wire frontend and backend to enforce authentication and authorization using ctx.auth.getUserIdentity() and token validation
  • Implement a minimal users identity mapping and role-based access control when the app requires user records

Quick Start

Choose an auth provider, wire convex/auth.config.ts, and protect a sample query with ctx.auth.getUserIdentity().

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 backend?

Convex authentication setup requires wiring convex/auth.config.ts with your selected provider, implementing frontend login flows, and enforcing backend authorization checks using ctx.auth.getUserIdentity() for secure token validation.

Does Convex auth support Clerk and WorkOS AuthKit?

Yes, Convex auth supports Clerk, WorkOS AuthKit, Auth0, custom JWT providers, and Convex Auth. You configure token validation and identity mapping in auth.config.ts to align with your specific provider.

How do I implement role-based access control with Convex Auth?

Implement role-based access control in Convex by creating a users table for identity mapping, linking authenticated identities from ctx.auth.getUserIdentity() to user records, and enforcing role-based checks in backend queries and mutations.

What is the best way to map user identities across Convex backends?

The best way to map user identities in Convex is to implement a users table that links token identities from ctx.auth.getUserIdentity() to application user records, ensuring consistent authorization checks across backend queries.

Can I use a custom JWT provider for login and signup in Convex?

Yes, you can use a custom JWT provider for Convex authentication. You must configure convex/auth.config.ts to validate your custom JWT tokens and wire backend authorization checks to align with your custom identity provider.

Why do I need an auth.config.ts file for Convex access control?

You need auth.config.ts for Convex access control because it defines how the backend validates tokens from your auth provider. It is required to wire frontend authentication with backend authorization checks like ctx.auth.getUserIdentity().