README
Secretary - NodeJS Secrets Management
Secretary (etymology: Keeper of secrets) provides an abstract way to manage secrets.
Currently supports the following adapters:
Installation
// If you want to use AWS Secrets Manager
$ npm install @secretary/core @secretary/aws-secrets-manager
// If you want to use Hashicorp Vault
$ npm install @secretary/core @secretary/vault
Check the install docs of the adapter you want to use for specific instructions.
Usage
import Secretary from '@secretary/core';
import Adapter from '@secretary/aws-secrets-manager';
import {SecretsManager} from 'aws-sdk';
const manager = new Secretary({
adapter: new Adapter({client: new SecretsManager()})
});
async function main() {
const someSecret = await manager.getSecret({key: 'host', path: 'database/redis/main'});
console.log(someSecret); // redis://localhost:6379
}
Check the usage docs of the adapter you want to use for specific instructions.