shawnS
Convex Community2w ago
10 replies
shawn

Type-safe access to environment variables in Convex with `convex-env`

For all those who enjoy the benefits of t3-env, I created a similar package bringing those benefits natively to Convex, giving you validated type-safe access to environment variables defined as a Convex schema.

This gives you the reassurance that when you use an environment variable in your code, it will:
- Actually be there
- Be the type you expect it to be

It can also prevent you from shipping bugs to production. If an environment variable is missing or doesn't match its validator, your deployment to Convex will fail.

npm i convex-env

if you spot any issues, lmk!
https://x.com/bentsignal/status/2007159617714061503
shawn (@bentsignal)
For all those who enjoy the benefits of @theo's t3-env, I created a similar package bringing those benefits natively to @convex.

Get validated type-safe access to environment variables defined as a Convex schema.
Preview image

X

1/2/26, 6:38 PM

Was this page helpful?