jamies1211
jamies1211
TTCTheo's Typesafe Cult
Created by jamies1211 on 5/22/2023 in #questions
How to handle deployment only environment variables with @t3-oss/env-nextjs?
Hi there, hope this is in the right place for this question. I wanna start using @t3-oss/env-nextjs to handle my environment variables however I have a few differences between the set of variables used in production and development and was wondering the recomended way to deal with this. Ideally I would like this to be a union type so I can achieve type narrowing. For now I am using optional but I may change to setting defaults. In the event that it may help to know why / what is different this is the list: 1- Vercel deployment environment variables - https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables 2- Google Cloud SQL I use SSL connection when in prod with SSL certificates stored in Vercel, however in development I use CloudSQLProxy instead so none of the SSL stuff is defined 3- Our mail provider does not let you have multiple API keys for different channels (🤮) so we just don't send mail in development.
2 replies