Is it possible to add custom prefixes to system environment variables? #227
-
I have a Sanity Studio app hosted on Vercel. (It's in a monorepo with a Next.js app.) I want to use the As far as I can tell, the only way to add prefixes to the system variables is to use a framework preset, but there isn't one for Sanity. Is there another way to make these variables work in my project? I've read through the docs and couldn't find a way to add a custom prefix to the system variables to map the variables to new ones. I tried this approach suggested in an SO comment of mapping |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@acrobertson Curious, have you tried adding the |
Beta Was this translation helpful? Give feedback.
@acrobertson Curious, have you tried adding the
process.env
part here →SANITY_STUDIO_VERCEL_GIT_COMMIT_REF=${process.env.VERCEL_GIT_COMMIT}
. If this doesn't work, you can use anext.config.js
file → https://github.com/vercel/next.js/blob/canary/examples/with-env-from-next-config-js/next.config.js (we don't recommend this method over the Environment Variables UI unless necessary).