t-convex-nextjs-saas/src/lib/auth-server.ts
nxtkofi 40b5c98e51 feat(env): add Zod env validation and update auth-server
Add src/lib/env.ts with runtime Zod validation for NEXT_PUBLIC_* variables. Update auth-server to use validated env instead of process.env directly.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-21 21:09:05 +02:00

16 lines
363 B
TypeScript

import { convexBetterAuthNextJs } from '@convex-dev/better-auth/nextjs';
import { env } from './env';
export const {
handler,
preloadAuthQuery,
isAuthenticated,
getToken,
fetchAuthQuery,
fetchAuthMutation,
fetchAuthAction,
} = convexBetterAuthNextJs({
convexUrl: env.NEXT_PUBLIC_CONVEX_URL,
convexSiteUrl: env.NEXT_PUBLIC_CONVEX_SITE_URL,
});