Convex-Zen is a production-grade authentication component designed for applications leveraging the Convex backend. Currently at version 1.13.5, it offers a robust, reusable auth solution. The package is actively maintained with frequent releases, typically multiple bug fixes and dependency updates within a month, reflecting ongoing development. Its key differentiator from Convex's 'Better Auth' integration is that Convex-Zen implements native authentication logic directly within Convex component functions, rather than importing an external runtime into app code. It provides framework-specific exports, allowing seamless integration with popular environments like Next.js, Tanstack Start, and Expo, while exposing a consistent and familiar API surface for developers.
npm install convex-zenVerified import paths — ran on the pinned version, not inferred.
This quickstart illustrates the essential steps to set up Convex-Zen authentication, including defining provider configurations, integrating with Convex's auth bridge, wiring the framework-specific provider (using Tanstack Start as an example), and executing the necessary code generation step.
Always align your `convex` dependency with the version range specified in `convex-zen`'s `peerDependencies`. For `convex-zen@1.13.5`, `convex@^1.35.1` is currently required.
Ensure you use the correct subpath import for your framework, such as `import { ConvexProviderWithAuth } from 'convex-zen/next';` or `convex-zen/tanstack-start`.Meticulously follow the setup instructions for `zen.config.ts` and `auth.config.ts`. Always run `npx convex-zen generate` after any changes to these configuration files or your Convex schema.
Configure your project to use ESM where possible, or ensure your build tools (e.g., Webpack, Rollup) are set up to correctly transpile and resolve ESM imports. The fix in v1.13.1 for 'explicit ESM import extensions' highlights this module compatibility.
Double-check the import path for the framework-specific component (e.g., `convex-zen/next`, `convex-zen/tanstack-start`). Ensure your project's build setup correctly handles package `exports` for subpath imports.
Verify that your `tsconfig.json` has `"module": "ESNext"` (or a modern equivalent) and that your bundler is configured for full ESM compatibility. Confirm that `ConvexProviderWithAuth` is indeed a named export and not a default export.
Ensure your main application component is wrapped by `ConvexProviderWithAuth` (or its framework-specific equivalent from `convex-zen`), and that a properly initialized `ConvexReactClient` instance is passed as the `client` prop.