convex-auth
Installation
SKILL.md
Convex Auth
Complete guide for authentication and authorization in Convex apps using @convex-dev/auth.
Critical Rules
- Always validate auth server-side — client-side
<Authenticated>is UX only, not security. - Use
getAuthUserId(ctx)in every query/mutation that needs auth — never trust the client. - Authenticated !== Authorized — always check permissions after confirming identity.
- Use
expo-secure-storefor React Native token storage — neverAsyncStorage. - Polyfills are required for React Native — import them before any other code in
_layout.tsx. - Callback URLs use
.sitenot.cloud— format:https://<deployment>.convex.site/api/auth/callback/<provider>. - Separate OAuth apps for development and production environments.
- Use
ConvexErrorfor auth/authz errors to provide structured error responses.