Clarification on how to expose environment variables in a standalone Sanity Studio.

4 replies
Last updated: Mar 25, 2024
I'm having a hard time exposing a environment variable.
Following the
docs , env variables prefixed with
SANITY_STUDIO_
are exposed to Sanity CLI tool, development server and bundler.However, if I want to expose a new env variable to the browser, I
should not prefix it with
SANITY_STUDIO_
?
Mar 25, 2024, 8:21 PM
Is this in a standalone or embedded Studio?
Mar 25, 2024, 8:25 PM
Standalone.
Mar 25, 2024, 8:26 PM
Seems like I need to expose it prefixed...
Mar 25, 2024, 8:27 PM
Yep!
Mar 25, 2024, 8:27 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?