Creates typed environment variables for a Next.js app using t3-oss env.
// Source: https://github.com/nextify-limited/saasfly | License: MIT | Copyright 2024 saasfly
// Provided via justclaw.it.com; keep this notice with the code.
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
server: {
// This is optional because it's only used in development.
// See https://next-auth.js.org/deployment.
NEXTAUTH_URL: z.string().url().optional(),
NEXTAUTH_SECRET: z.string().min(1),
GITHUB_CLIENT_ID: z.string().min(1),
GITHUB_CLIENT_SECRET: z.string().min(1),
STRIPE_API_KEY: z.string().min(1),
STRIPE_WEBHOOK_SECRET: z.string().min(1),
RESEND_API_KEY: z.string().min(1),
RESEND_FROM: z.string().min(1),
ADMIN_EMAIL: z.string().optional(),
IS_DEBUG: z.string().optional(),
}
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key