convex-setup-auth

Configure Convex authentication providers and enforce server-side identity checks.

Updated May 22, 2026
One-click install
npx skills add https://github.com/ekawijayasusilo/kmp_template --skill convex-setup-auth-ekawijayasusilo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-setup-auth
Source: https://github.com/ekawijayasusilo/kmp_template/tree/main/.claude/skills/convex-setup-auth
Command: npx skills add https://github.com/ekawijayasusilo/kmp_template --skill convex-setup-auth-ekawijayasusilo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill solves the problem of setting up secure authentication in a Convex app, including identity lookup and backend access control, so protected functions can reliably determine who the user is.

Core Features & Use Cases

  • Provider-first setup: Choose and configure the correct Convex authentication provider (Convex Auth, Clerk, WorkOS AuthKit, Auth0, or custom JWT) based on the app’s existing dependencies and environment.
  • Identity mapping & protected backend checks: Implement the correct server-side pattern using ctx.auth.getUserIdentity() instead of trusting client-provided user identifiers.
  • Role- and ownership-ready authorization: Add authorization checks for ownership, roles, or team access only where the application actually needs them.

Use cases: Adding login to a new Convex project, wiring an existing frontend that already uses Clerk/Auth0/WorkOS into Convex backend authentication, and creating a production-ready auth configuration with correct environment variables.

Quick Start

Use the convex-setup-auth skill to set up Convex authentication for your selected provider in your project, following the provider-specific reference and the Convex backend authorization pattern.

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

Setting up Convex authentication requires selecting an identity provider, configuring environment variables, and initializing the auth configuration to securely verify user identities.

How do I get user identity in Convex functions without trusting client inputs?

To get user identity safely, use `ctx.auth.getUserIdentity()` in your server-side functions. This retrieves verified identity data directly from the backend auth context, preventing spoofing from client-side userId values.

Can I use Clerk or Auth0 for login with my Convex application?

Yes, Convex authentication supports wiring existing frontends that use Clerk, Auth0, WorkOS AuthKit, or custom JWT providers. Configuration is handled via provider-specific local reference files and environment variables.

What is the best way to enforce ownership and role-based access control in Convex?

Enforcing authorization in Convex involves adding server-side checks for ownership, roles, or team access within your queries and functions. These checks rely on the verified identity obtained through `ctx.auth.getUserIdentity()`.

Why does my Convex auth configuration require provider-specific environment variables?

Convex auth configuration requires provider-specific environment variables to establish a trusted connection between your backend and the identity provider. Without them, the Convex backend cannot validate tokens issued by providers like Clerk or Auth0.