@varlock/astro-integration
v0.1.0
Published
Astro integration to use varlock for .env file loading - adds validation, type-safety, and extra security features
Readme
@varlock/astro-integration
This package helps you integrate varlock into an Astro project.
See our docs site for complete installation and usage instructions.
It is designed as an Astro integration, which will override Astro's default .env file loading logic (powered by Vite), to instead use varlock.
Compared to the default Astro behavior, this package provides:
- Validation of your env vars against your
.env.schema - Type-generation and type-safe env var access with built-in docs
- Redaction of sensitive from logs during build time
- Automatic leak prevention of sensitive items at build and runtime
- More flexible multi-env handling, rather than relying on the
--modeflag
While some of these features are similar to what can be accomplished via astro:env, this integration provides additional security features and more flexible multi-env handling.
- Facilitates loading and composing multiple
.envfiles - You can use validated env vars right away within your
astro.config.*file - Facilitates setting values and handling multiple environments, not just setting defaults
- More data types and options available
- Leak detection, log redaction, and more security guardrails
- Works with various adapters and platforms to make your resolved config available
