Environment Variables API Reference
यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।
जोड़ा गया:
astro@5.0.0
बीटा
The astro:env
API lets you configure a type-safe schema for environment variables you have set. This allows you to indicate whether they should be available on the server or the client, and define their data type and additional properties. For examples and usage instructions, see the astro:env
guide.
Imports from astro:env
Section titled Imports from astro:envgetSecret()
Section titled getSecret()
जोड़ा गया:
astro@5.0.0
बीटा
The getSecret()
helper function allows retrieving the raw value of an environment variable by its key.
For example, you can retrieve a boolean value as a string:
This can also be useful to get a secret depending on dynamic data, such as from a database or API.
If you need to retrieve environment variables programmatically, we recommend using getSecret()
instead of process.env
(or equivalent). Because its implementation is provided by your adapter, you won’t need to update all your calls if you switch adapters. It defaults to process.env
in dev and build.