auth-setup

Set up secure authentication and user management for Convex applications.

107|12|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/get-convex/convex-agent-plugins --skill auth-setup-get-convex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-setup
Source: https://github.com/get-convex/convex-agent-plugins/tree/main/skills/auth-setup
Command: npx skills add https://github.com/get-convex/convex-agent-plugins --skill auth-setup-get-convex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Secure authentication and user management for Convex apps, including identity mapping and access control.

Core Features & Use Cases

  • Sets up a users table with identity tokenIdentifier index for linking external identities to local user records
  • Provides helper functions like getCurrentUser and getCurrentUserOrNull to simplify auth-aware queries
  • Includes storeUser mutation to create or update user records on first sign-in and subsequent logins
  • Demonstrates robust access control patterns (owner, resource, and team-based permissions) and client provider integration

Quick Start

Create the users table with identity mapping, implement getCurrentUser and storeUser, and wire a provider (WorkOS/Auth0) for sign-in.

Frequently Asked Questions about auth-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up authentication in Convex?

To set up Convex authentication, create a users table with a tokenIdentifier index, implement a storeUser mutation for first sign-in, and wire an OAuth provider like WorkOS or Auth0 for client-side sign-in.

What is identity mapping in Convex auth?

Identity mapping links external OAuth identities to local user records using a tokenIdentifier index, allowing your Convex application to securely manage user provisioning and access control across client and server code.

Does Convex auth work with Auth0 and WorkOS?

Yes, Convex auth integration works with both Auth0 and WorkOS. The setup involves wiring your chosen provider for client-side sign-in and mapping their external identities to your local users table.

How do I get the current user in a Convex query?

You can get the current user in a Convex query by using a helper function like getCurrentUser or getCurrentUserOrNull, which simplifies auth-aware queries by fetching the authenticated user's record.

How do I implement access control in Convex?

Implement Convex access control by applying robust authorization patterns across client and server code, including owner-based, resource-based, and team-based permissions to restrict data access.