Adding a staging environment using the T3 stack (deployed on Vercel)
Hi,
I'm creating a SaaS product and I used the T3 stack to bootstrap it. I already have a dev and prod environment (deployed to DigitalOcean, not Vercel), and I'd like to add a staging environment as well, but deployed to Vercel.
It seems Next.js doesn't want people to use any env vars except for development, test and production (https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#environment-variable-load-order).
I also found this discussion https://github.com/vercel/next.js/discussions/12077 but there doesn't seem to be a good official solution. Why isn't this trivially addressed in the docs when so many businesses relying on Next.js surely use a staging environment to scale their products?
What's the best way to setup such an environment? One that simulates production that I can use for closely replicating prod (probably with some mock data) when adding new features?
Thanks in advance
GitHub
How to setup custom environment variables other than development an...
Hi, I would like to know how can I create a custom environment variable lets say staging and specify it during build time script like npm run build --env.env=staging? I looked here but didn't l...
Configuring: Environment Variables | Next.js
Learn to add and access environment variables in your Next.js application.
0 Replies