Convex Auth
ConvexOfficialPublished by Convex
- Skill
- Workflow
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured, non-interactive workflow for integrating authentication into a Convex application. It focuses on avoiding common pitfalls such as interactive CLI hangs and misconfigured auth.config.ts files. The process covers package installation, headless generation of cryptographic keys, environment variable deployment, and client-side wiring, ensuring a robust and functional authentication flow.
What it does
- Installs and configures @convex-dev/auth for Convex projects.
- Generates JWT keys headlessly using jose to avoid interactive CLI issues.
- Sets up required environment variables for deployment via secure methods.
- Writes the critical auth.config.ts file to prevent silent authentication failures.
- Wires client-side providers and UI components for sign-in functionality.
- Verifies the complete authentication round-trip.
When to use it
- When adding authentication to a new or existing Convex application.
- When you need to implement passkey, OAuth, or password-based authentication.
- When working in headless or CI environments where interactive CLI wizards fail.
- When you want to ensure the auth.config.ts file is correctly wired to avoid silent sign-out bugs.
Advantages
- Prevents common authentication configuration errors.
- Enables automated, non-interactive setup suitable for CI/CD pipelines.
- Ensures consistent and secure handling of cryptographic keys.
- Reduces development time by providing a clear, step-by-step integration path.
Usage examples
- “Add passkey authentication to my current Convex project.”
- The agent will install the necessary packages, generate the required JWT keys, configure the server-side auth files, and set up the client-side provider.
- “Configure Google OAuth for my Convex app.”
- The agent will follow the authentication workflow, specifically configuring the OAuth provider in the auth setup and ensuring all environment variables are correctly deployed.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/convex/convex-auth/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip convex-auth.zip -d .agents/skills
Documentation by Convex
<!-- GENERATED from convex-agents content/capabilities/auth.json — do not edit by hand. -->
Add sign-in to the app
Install and wire @convex-dev/auth for the current app: a provider (passkeys by default, or OAuth/password), the server config, the client hooks, and a sign-in UI — correctly, including the auth.config.ts that's the #1 real-world auth footgun.
Workflow
Install @convex-dev/auth (pinned build) and add it to convex.config.ts. With pnpm, also
pnpm add jose(it won't hoist otherwise); you need it for step 3.Add the provider in convex/auth.ts (Passkey by default; Password or OAuth like Google on request).
Generate the auth keys HEADLESSLY. Do NOT run the interactive
npx @convex-dev/authwizard: it needs a login/TTY and hangs in non-interactive, anonymous, or CI runs (the #1 auth time-sink). Generate JWT_PRIVATE_KEY + JWKS deterministically withjose: node -e 'import("jose").then(async({generateKeyPair,exportPKCS8,exportJWK})=>{const k=await generateKeyPair("RS256",{extractable:true});const priv=await exportPKCS8(k.privateKey);const pub=await exportJWK(k.publicKey);process.stdout.write(JSON.stringify({JWT_PRIVATE_KEY:priv.trimEnd().replace(/\n/g," "),JWKS:JSON.stringify({keys:[{use:"sig",...pub}]})}))})' > .auth-keys.json Then set JWT_PRIVATE_KEY and JWKS (from .auth-keys.json) plus SITE_URL on the deployment. Prefer the Convex MCPenvSettool, one call per var, to avoid shell-quoting the multi-line key. CLI fallback: use the NAME=VALUE form (npx convex env set "JWT_PRIVATE_KEY=$JWT"), NEVERenv set JWT_PRIVATE_KEY "$JWT"(the value starts with-----BEGINand the CLI parses the leading-as an unknown flag). SITE_URL is the dev URL (e.g. http://localhost:3000). Delete .auth-keys.json after.Write convex/auth.config.ts (the silently-always-signed-out bug lives here if it's wrong).
Wire the client: ConvexAuthProvider, the sign-in component, and route guards. If you import shadcn/ui primitives (button, input, textarea, label, and so on), add them first with
npx shadcn@latest add <name>; a missing @/components/ui/* is a hard build error.Verify a sign-in round-trips before declaring done.
Rules
Generate JWT_PRIVATE_KEY/JWKS with
jose(extractable RS256; PKCS8 newlines to spaces; JWKS = {keys:[{use:"sig", ...publicJwk}]}). Do NOT run the interactivenpx @convex-dev/authwizard: it hangs headless/anonymous. Set the vars via the MCPenvSettool or the NAME=VALUE CLI form.Always write auth.config.ts: a missing/incorrect one makes the app silently always-signed-out with no error.
Passkeys by default; only switch to password/OAuth on explicit request.
Install any shadcn/ui primitive you import up front (
npx shadcn@latest add ...); a missing @/components/ui/* is a hard build failure.Verify a real sign-in works before finishing.
Files
- ATTRIBUTION.mdAdded by AutoGineer846 B
- LICENSELicence file added by AutoGineer10.7 KiB
- SKILL.md2.9 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "convex-auth", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: f60629d7c6c1f27eb58a56260546d2445049274d
Published by: Convex (https://github.com/convex)
Publisher: Convex (https://github.com/convex)
Licence: Apache License 2.0 (https://github.com/convex/agent-skills/blob/f60629d7c6c1f27eb58a56260546d2445049274d/LICENSE)
Licence evidence: repository licence LICENSE
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Convex
- Publisher
- Convex (Official)
- Source
- convex/agent-skills · skills/convex-auth · commit f60629d
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Convex or Convex.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download convex-auth.zip