docs icon indicating copy to clipboard operation
docs copied to clipboard

Environment Variables for integrations can be handled different than Astro

Open chexxor opened this issue 9 months ago • 6 comments

📚 Subject area/topic

environment variables

📋 Page(s) affected (or suggested, for new content)

https://docs.astro.build/en/guides/environment-variables/ https://docs.astro.build/en/guides/integrations-guide/cloudflare/#cloudflare-runtime

📋 Description of content that is out-of-date or incorrect

The Astro docs say that the environment variables can be set using a .env file. Cloudflare and its Wrangler tool use .dev.vars instead if that one.

The Astro docs say that environment variables can be read using the import.meta.env object. When running on Cloudflare, however, the Cloudflare integration places them on the Astro.locals.runtime.env object, or the context.locals.runtime.env object in endpoints.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

chexxor avatar Jan 22 '25 18:01 chexxor