npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reaatech/secret-rotation-provider-vault

v0.1.0

Published

HashiCorp Vault provider for Secret Rotation Kit

Readme

@reaatech/secret-rotation-provider-vault

npm version License: MIT CI

Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.

HashiCorp Vault KV v2 adapter for Secret Rotation Kit. Implements the SecretProvider interface for Vault's key-value secrets engine.

Installation

npm install @reaatech/secret-rotation-provider-vault node-vault
# or
pnpm add @reaatech/secret-rotation-provider-vault node-vault

node-vault is an optional peer dependency, loaded lazily at runtime. Install it alongside this package; if it's missing the adapter throws a clear error telling you to install it.

Feature Overview

  • Full SecretProvider implementation — CRUD, versioning, rotation sessions, and health checks
  • KV v2 backend — automatic versioning on every write
  • Token and AppRole auth — supports both token and roleId/secretId authentication
  • ESM-compatible — dynamically loads node-vault via createRequire for pure-ESM consumers
  • Metadata tracking — rotation state tracked via custom metadata on secret versions

Quick Start

import { VaultProvider } from '@reaatech/secret-rotation-provider-vault';
import { RotationManager } from '@reaatech/secret-rotation-core';

const provider = new VaultProvider({
  url: 'http://localhost:8200',
  mountPath: 'secret',
  token: 'hvs.xxxx',
});
const manager = new RotationManager({ providerInstance: provider });
await manager.rotate('database-password');

API Reference

VaultProvider

Constructor

new VaultProvider(config: VaultProviderConfig)

VaultProviderConfig

| Property | Type | Required | Description | |----------|------|----------|-------------| | type | "vault" | Yes | Discriminator | | url | string | Yes | Vault server URL | | mountPath | string | Yes | KV engine mount path (e.g., "secret") | | token | string | No | Authentication token | | roleId | string | No | Role ID for AppRole authentication | | secretId | string | No | Secret ID for AppRole authentication |

SecretProvider Methods

| Method | Description | |--------|-------------| | createSecret(name, value) | Write initial secret value to KV v2 path | | getSecret(name, version?) | Read secret value. Defaults to latest version. | | storeSecretValue(name, value, options?) | Write new version. New writes auto-create versions in KV v2. { stage: "pending" } sets pending metadata. | | deleteSecret(name, options?) | Delete secret path and all versions | | listVersions(name) | List all versions with creation timestamps and metadata | | getVersion(name, versionId) | Read a specific version by ID | | deleteVersion(name, versionId) | Delete a specific version | | supportsRotation() | Returns true | | beginRotation(name) | Creates a rotation session with initial metadata | | completeRotation(session) | Promotes pending version (removes rotation metadata) | | cancelRotation(session) | Removes rotation metadata from pending version | | health() | Health check via Vault's /sys/health endpoint | | capabilities() | Returns supportsRotation: true, supportsVersioning: true, supportsLabels: false |

Rotation Flow

beginRotation()           → creates session metadata on the secret
storeSecretValue(pending) → writes new KV v2 version with pending metadata
completeRotation()        → promotes pending version, removes rotation metadata
cancelRotation()          → cleans up pending metadata

Usage Patterns

Token Authentication

const provider = new VaultProvider({
  url: 'https://vault.example.com',
  mountPath: 'secret',
  token: process.env.VAULT_TOKEN,
});

AppRole Authentication

const provider = new VaultProvider({
  url: 'https://vault.example.com',
  mountPath: 'kv',
  roleId: process.env.VAULT_ROLE_ID,
  secretId: process.env.VAULT_SECRET_ID,
});

Explicit Provider Instance

import { VaultProvider } from '@reaatech/secret-rotation-provider-vault';
import { RotationManager } from '@reaatech/secret-rotation-core';

const provider = new VaultProvider({
  url: 'http://localhost:8200',
  mountPath: 'secret',
  token: 'hvs.xxxx',
});
const manager = new RotationManager({ providerInstance: provider });

Dynamic Provider Selection

import '@reaatech/secret-rotation-provider-vault'; // registers 'vault' type
import { createProvider } from '@reaatech/secret-rotation-types';

const provider = createProvider({
  type: 'vault',
  url: 'http://localhost:8200',
  mountPath: 'secret',
  token: 'hvs.xxxx',
});

Related Packages

License

MIT