# vault-provider

> NodeJS dataverse Vault Provider

Latest version **1.0.2** (published 2024-04-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install vault-provider
pnpm add vault-provider
yarn add vault-provider
bun add vault-provider
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-04-15 |
| First published | 2024-02-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 66.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Byteverse |
| Maintainers | anokhi0895 |
| Keywords | Vault, node-vault, logger |

## Links

- npm: https://www.npmjs.com/package/vault-provider
- Repository: https://gitlab.byteprophecy.accenture.com/dataverse/common-nodejs-components
- Homepage: https://gitlab.byteprophecy.accenture.com/dataverse/common-nodejs-components/packages/vault-provider#readme
- Issues: https://gitlab.byteprophecy.accenture.com/dataverse/common-nodejs-components/issues
- npm.io page: https://npm.io/package/vault-provider

## Dependencies (4)

- [node-vault](https://npm.io/package/node-vault.md) ^0.10.2
- [http-status](https://npm.io/package/http-status.md) ^1.5.0
- [commonjs-errors](https://npm.io/package/commonjs-errors.md) ^1.0.0
- [commonjs-logger](https://npm.io/package/commonjs-logger.md) ^1.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-04-15
- 1.0.1 — 2024-04-12
- 1.0.0 — 2024-02-26

## README

# `vault-provider`

> node-vault Facade to use in dataverse NodeJS projects

## Config

| Name                                        | Description                                                                                     |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------  |
| vaultAddr                                   | The URL of the Vault with port                                                                  |
| vaultSecretPath                             | Path of the secrets to be used in the application                                               |
| vaultAuthType                               | Authentication type. Only 'userpass' is supported as of now                                     |
| vaultUser                                   | If the auth type is 'userpass', provide a username                                              |
| vaultPassword                               | If the auth type is 'userpass', provide a password                                              |

## Usage

```js
import VaultProvider from 'vault-provider';
import { VaultOptions } from 'kafka-provider';
import { Config as LoggerConfig } from 'commonjs-logger';
import { vaultAddr, vaultAuthType, vaultPassword, vaultSecretPath, vaultUser } from '../config/config';

const config: VaultOptions = {
  vaultAddr,
  vaultSecretPath,
  vaultAuthType,
  vaultUser,
  vaultPassword,
};

const loggerConfig: LoggerConfig = {
  logLevel: loggerLogLevel,
  logStyle: loggerLogStyle,
  appName: appName,
  moduleName: 'VaultProvider',
};

const provider = new VaultProvider(config, loggerConfig);

export default provider;

// Initialize
import vaultProvider from './providers/vault';
await vaultProvider.initialize();

// Write something to the Vault
await vaultProvider.write(user.id, secretAccessKey);

// Read something from the Vault
const secretAccessKey = await vaultProvider.read(user.id);
```

---
_Source: https://npm.io/package/vault-provider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
