-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
async env variables #146
Comments
It's possible right now, but not the way you expected. import { createEnv as createT3Env } from "@t3-oss/env-core";
import { z } from "zod";
async function loadEnv() {
const value = await fetch("myurl.com").then(async (r) => await r.json());
return createEnv({
server: {
MY_ENV: z.string(),
},
runtimeEnv: {
MY_ENV: value,
},
});
}
// Usage
const env = await loadEnv() |
Did it work for you @SaadBazaz ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
I was wondering if it was possible to update env variables async at boottime? I have an env variable based on a server-side call, so would love to have something like:
The text was updated successfully, but these errors were encountered: