convex-zen
v1.20.0
Published
Production-grade auth component for Convex
Readme
convex-zen
Production-grade authentication for Convex, built as a reusable component package.
convex-zen is a native Convex auth component and an alternative to:
- the Better Auth Convex component: https://github.com/get-convex/better-auth
- Convex Auth: https://labs.convex.dev/auth
Supported Today
- Next.js App Router
- TanStack Start
- Expo
The canonical framework examples live in:
apps/nextapps/tanstack
Start Here
For agents and one-shot installs, start with:
LLMS.mdnpx convex-zen doctor- the scenario doc returned by
doctor
Public install docs live under apps/docs/external/install.
Shared auth docs:
apps/docs/external/oauth.mdapps/docs/external/oauth-proxy.md
Choose Your Starting Point
| Project state | Recommended command | Doc |
| --- | --- | --- |
| Existing Next.js app with Convex, no auth | npx convex-zen doctor | apps/docs/external/install/next/add-to-existing-convex.md |
| Existing TanStack Start app with Convex, no auth | npx convex-zen doctor | apps/docs/external/install/tanstack-start/add-to-existing-convex.md |
| Existing Next.js app using Convex Auth | npx convex-zen doctor | apps/docs/external/install/next/migrate-from-convex-auth.md |
| Existing TanStack Start app using Better Auth | npx convex-zen doctor | apps/docs/external/install/tanstack-start/migrate-from-better-auth.md |
| Framework app exists but Convex does not | npx convex-zen doctor | framework from-scratch.md guide |
| No supported framework app yet | read apps/docs/external/install/README.md | install overview |
Install Model
The canonical setup model is:
- author
convex/zen.config.ts - add
convex/auth.config.ts - run
npx convex-zen generate - wire the framework adapter to
convex/zen/_generated/meta.ts - mount the framework auth provider and auth route
OAuth note:
- direct OAuth is the default
- single-callback provider support is available through the opt-in broker mode documented in
apps/docs/external/oauth-proxy.md
Generated files in convex/zen/* are not hand-edited.
Key Files
User-authored:
convex/zen.config.tsconvex/auth.config.ts- framework auth server/client files
Generated:
convex/zen/core.tsconvex/zen/plugin/*convex/zen/_generated/auth.tsconvex/zen/_generated/meta.ts
Commands
Install the package in an app:
pnpm add convex convex-zenDetect project state:
npx convex-zen doctorGenerate Convex wrappers:
npx convex-zen generateWorkspace
- Library package:
packages/convex-zen - Demo apps:
apps/next,apps/tanstack,apps/expo - Public docs source:
apps/docs/external - Internal architecture notes:
apps/docs/internal - Project background:
PROJECT.md
Testing and Build
pnpm -C packages/convex-zen test
pnpm -C packages/convex-zen build
pnpm -C packages/convex-zen build:dist
pnpm -C apps/next build
pnpm -C apps/tanstack buildLicense and Attribution
- Repository license:
LICENSE(Apache License 2.0) - Required notices:
NOTICE - Third-party provenance and notices:
THIRD_PARTY_NOTICES.md
