Install
Try it without a vault
Thelocal provider reads a gitignored JSON file, so you can see the mechanism
work before wiring up AWS or Bitwarden.
1
Create a mock vault
.secrefs.local.json
2
Write a reference instead of a value
.env
3
Run your app through SecRefs
process.env.DB_PASSWORD exactly as before. Nothing downstream changes.Point it at a real vault
Swap the provider segment. Nothing else about your app changes:.env
VAULT_TOKEN. It never asks you to put a
credential in its own config. See AWS,
Bitwarden, and Vault.
Use it as a library
Check before you deploy
check validates every reference it can see and never returns a plaintext
value, so it is safe to run in CI:
Load time vs use time
init() and expandString() behave differently when a secret rotates. The
difference matters — read this before choosing.