Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to extend presets #170

Merged
merged 7 commits into from
Jan 24, 2024
Merged

feat: add ability to extend presets #170

merged 7 commits into from
Jan 24, 2024

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Jan 24, 2024

#158 but with arrays and less checks for conflicting keys, can do that in a follow-up perhaps

import { createEnv } from "@t3-oss/env-nextjs";
import { vercel } from "@t3-oss/env-nextjs/presets";
import { z } from "zod";

export const env = createEnv({
  client: {
    NEXT_PUBLIC_GREETING: z.string(),
  },
  server: {
    SECRET: z.string(),
  },
  shared: {
    NODE_ENV: z.enum(["development", "production"]),
  },
  experimental__runtimeEnv: {
    NODE_ENV: process.env.NODE_ENV,
    NEXT_PUBLIC_GREETING: process.env.NEXT_PUBLIC_GREETING,
  },
  extends: [vercel],
});

env.VERCEL_URL; // string | undefined
// ...

Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
t3-env ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 1:43pm
t3-env-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 1:43pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant