# @piiano/testcontainers-vault

> Add a local Piiano Vault for testing purposes using testcontainers

Latest version **1.1.2** (published 2024-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @piiano/testcontainers-vault
pnpm add @piiano/testcontainers-vault
yarn add @piiano/testcontainers-vault
bun add @piiano/testcontainers-vault
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2024-01-28 |
| First published | 2023-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Ori Shalom |
| Maintainers | orish, nhaas2, shiftan |
| Keywords | Piiano, pvault, vault, pii, privacy, test, local |

## Links

- npm: https://www.npmjs.com/package/@piiano/testcontainers-vault
- Repository: https://github.com/piiano/vault-typescript
- Homepage: https://github.com/piiano/vault-typescript#readme
- npm.io page: https://npm.io/package/@piiano/testcontainers-vault

## Dependencies (1)

- [testcontainers](https://npm.io/package/testcontainers.md) ^10.6.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2024-01-28
- 1.1.1 — 2023-12-11
- 1.1.0 — 2023-08-06
- 1.0.4 — 2023-06-14
- 1.0.3 — 2023-06-07
- 1.0.2 — 2023-06-07
- 1.0.1 — 2023-04-18
- 1.0.0 — 2023-03-28

## README

# @piiano/testcontainers-vault

Testcontainers-vault helps you run a Piiano Vault container for testing purposes directly from your TypeScript tests.

## Requirements

- Docker - This module uses [testcontainers](https://www.npmjs.com/package/testcontainers) under the hood, which requires Docker to be installed and running.
- A valid Vault license - follow the [Vault getting started](https://piiano.com/docs/guides/get-started/) to obtain a free 30 days license (no credit card required)

## Installation

### Install with yarn

```bash
yarn add -D @piiano/testcontainers-vault
```

### Install with npm

```bash
npm install --save-dev @piiano/testcontainers-vault
```

## Usage

```typescript
import { Vault } from '@piiano/testcontainers-vault';

const vault = new Vault();

const port = await vault.start();

// Do something with the container
// ...

await vault.stop();
```

Calling to `new Vault()` can also accept a `VaultOptions` object to configure the container.

The `VaultOptions` can be used to specify the version of the Vault image to use, the port to expose on the host, the Vault license to use, and the environment variables to pass to the Vault container.

```typescript 
/**
 * Options for configuring a local Vault instance.
 */
export type VaultOptions = Partial<{
  /**
   * The version of the Vault image to use.
   */
  version: string;

  /**
   * The port to expose on the host.
   * If not specified, a random port will be used.
   */
  port: number;


  /**
   * The Vault license to use.
   * If not specified, try to use the license from the PVAULT_SERVICE_LICENSE environment variable.
   */
  license: string;

  /**
   * The environment variables to pass to the Vault container.
   */
  env: Record<string, string | number | boolean>;
}>
```

## License

[MIT](./LICENSE)

## More information

- [Piiano Vault](https://piiano.com)
- [Piiano Vault Documentation](https://piiano.com/docs)

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