Skip to content

Environment Variables for integrations can be handled different than Astro #10757

Open
@chexxor

Description

📚 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

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues looking for someone to run with them!improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions