DEV Community

Discussion on: Using secure environment variables in SvelteKit and Netlify

Collapse
rchrdnsh profile image
rchrdnsh

This is helpful, thank you. How do I access the variable inside a page, tho?

Collapse
brewhousedigital profile image
Brewhouse Digital Author

Hi rchrdnsh! I haven't tested this but SvelteKit's FAQ has a section on referencing your environment variables inside your pages and components. Looks like you have to prefix it with the text "VITE_"

kit.svelte.dev/faq#env-vars
Hope this helps.