Skip to main content
Glama
env.ts1.44 kB
import { createEnv } from "@t3-oss/env-nextjs"; import { z } from "zod"; import { vercel } from "@t3-oss/env-nextjs/presets-zod"; export const env = createEnv({ /** * Built-in environment variables from Vercel */ extends: [vercel()], /** * Specify your server-side environment variables schema here. This way you can ensure the app * isn't built with invalid env vars. */ server: { NODE_ENV: z.enum(["development", "test", "production"]).default("development"), }, /** * Specify your client-side environment variables schema here. This way you can ensure the app * isn't built with invalid env vars. To expose them to the client, prefix them with * `NEXT_PUBLIC_`. */ client: { NEXT_PUBLIC_SITE_URL: z.string().url().optional(), }, /** * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g. * middlewares) or client-side so we need to destruct manually. */ runtimeEnv: { NODE_ENV: process.env.NODE_ENV, NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL, }, /** * Run `build` or `dev` with SKIP_ENV_VALIDATION to skip env validation. This is especially * useful for Docker builds. */ skipValidation: !!process.env.SKIP_ENV_VALIDATION, /** * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and * `SOME_VAR=''` will throw an error. */ emptyStringAsUndefined: true, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lightfastai/lightfast-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server