What problem does it solve?
Provide a clear, repeatable pattern for authenticating users in Convex applications and mapping external provider identities to application users so that authentication, authorization, and user management are consistent and secure.
Core Features & Use Cases
- User provisioning and identity mapping: guidance for creating a users table with a tokenIdentifier index and upserting users on first sign-in.
- Auth helper functions: patterns for getCurrentUser, getCurrentUserOrNull, and requireAdmin to centralize authentication checks and error handling.
- Access control patterns: examples for owner-only operations, resource ownership checks, team-based membership gates, public vs private queries, and client integration with providers like WorkOS or Auth0.
- Client and environment setup: directions for wiring Convex client auth to a provider token, required environment variables, and calling storeUser on sign-in.
Quick Start
Set up a users table with a tokenIdentifier index, implement getCurrentUser and storeUser helpers in your Convex backend, and configure your client to supply provider tokens (for example WorkOS or Auth0) and call storeUser after sign-in.