✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

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 remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?