-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When following the setup instructions using the npm create sanity@latest init --env command in the app directory the script creates a .env file with the correct values for the environment variables. However the Names are incorrect.
It is created as:
app/.env
SANITY_PROJECT_ID="xxxxxxx"
SANITY_DATASET="production"When it should be:
app/.env
PUBLIC_SANITY_PROJECT_ID="xxxxxxx"
PUBLIC_SANITY_DATASET="production"This is due to the configuration that Public env variables have the Prefix of "PUBLIC_"
see the docs https://kit.svelte.dev/docs/modules#$env-static-public
Suggested Fix:
Easy way: Update the docs to inform people to edit the /app/.env file and prefix the generated variables with "PUBLIC_"
Hard way: add a flag to the install script to handle Framework specifics such as this. Something like npm create sanity@latest init --env --sveltekit
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels