Files
zopu-code/packages/env/src/native.ts
2026-07-19 02:46:47 +05:30

18 lines
558 B
TypeScript

import { createEnv } from "@t3-oss/env-core";
import { z } from "zod";
const convexUrlSchema = (exampleHost: string) =>
z.url().refine((url) => new URL(url).hostname !== exampleHost, {
message: `Replace the ${exampleHost} placeholder before running the app`,
});
export const env = createEnv({
clientPrefix: "EXPO_PUBLIC_",
client: {
EXPO_PUBLIC_CONVEX_URL: convexUrlSchema("example.convex.cloud"),
EXPO_PUBLIC_CONVEX_SITE_URL: convexUrlSchema("example.convex.site"),
},
runtimeEnv: process.env,
emptyStringAsUndefined: true,
});