Expiration Warnings
Expiration warnings help you track time-limited environment variables such as temporary API keys, tokens, or credentials. By annotating variables with an expiration date, dotenv-diff can warn you before credentials expire — or fail your pipeline when they already have.
Syntax
Add an @expire comment directly above the environment variable you want to track.
Strict Mode Integration
When running in --strict mode, expiration warnings are treated as errors.
Expired or soon-expiring variables cause the process to fail.
Configuration
Expiration warnings are enabled by default. You can disable them using a CLI flag or the configuration file.
Or in dotenv-diff.config.json:Why Use Expiration Warnings
- Prevent production failures caused by expired credentials.
- Encourage regular API key and token rotation.
- Document credential lifetimes directly in your environment files.
- Improve security hygiene in CI/CD pipelines.
Best Practices
- Always use the
YYYY-MM-DDdate format. - Add comments explaining why a variable has an expiration date.