-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Question: How to use with Expo #203
Comments
I don't know if I'm doing this right, but here is what I did and is working:
import { createEnv } from "@t3-oss/env-core"
import { z } from "zod"
export const env = createEnv({
clientPrefix: "EXPO_PUBLIC_",
client: {
EXPO_PUBLIC_GOOGLE_MAPS_API_KEY: z.string().min(1),
EXPO_PUBLIC_API_BASE_URL: z.string().url(),
},
runtimeEnv: {
EXPO_PUBLIC_GOOGLE_MAPS_API_KEY:
process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY,
EXPO_PUBLIC_API_BASE_URL: process.env.EXPO_PUBLIC_API_BASE_URL,
},
})
Then use the import { env } from "@/env"
env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY I hope it helps! |
also, I found a typescript issue when importing, so I added:
to the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I saw that this library supports expo but does not know how to implement it.
The text was updated successfully, but these errors were encountered: