Merged in feat/sw-2871-booking-flow-envs (pull request #2483)

feat(SW-2871): Add env setup to booking-flow package

* Add env setup to booking-flow package

* Add missing dep

* Really fix it..


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-07-01 08:27:48 +00:00
parent c41b2314bf
commit 9426f4b1ac
4 changed files with 28 additions and 2 deletions

18
packages/booking-flow/env/server.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod"
export const env = createEnv({
/**
* Due to t3-env only checking typeof window === "undefined"
* and Netlify running Deno, window is never "undefined"
* https://github.com/t3-oss/t3-env/issues/154
*/
isServer: typeof window === "undefined" || "Deno" in window,
server: {
FOO: z.string().optional(),
},
emptyStringAsUndefined: true,
runtimeEnv: {
FOO: process.env.FOO,
},
})