{"id":21238712,"url":"https://github.com/shahradelahi/node-vault","last_synced_at":"2025-04-10T06:18:51.234Z","repository":{"id":209070608,"uuid":"722533775","full_name":"shahradelahi/node-vault","owner":"shahradelahi","description":"🔐 Modern client for the HashiCorp's Vault API","archived":false,"fork":false,"pushed_at":"2025-02-25T17:10:50.000Z","size":372,"stargazers_count":345,"open_issues_count":2,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T22:55:39.085Z","etag":null,"topics":["client","hashicorp","secrets","typescript","vault"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@litehex/node-vault","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shahradelahi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-23T11:00:45.000Z","updated_at":"2025-03-19T14:37:23.000Z","dependencies_parsed_at":"2024-01-16T11:44:01.440Z","dependency_job_id":"f3da5039-1591-48a5-a2d7-c1f214ff9f73","html_url":"https://github.com/shahradelahi/node-vault","commit_stats":null,"previous_names":["shahradelahi/node-vault"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-vault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-vault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-vault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-vault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahradelahi","download_url":"https://codeload.github.com/shahradelahi/node-vault/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166864,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","hashicorp","secrets","typescript","vault"],"created_at":"2024-11-21T00:37:52.275Z","updated_at":"2025-04-10T06:18:51.210Z","avatar_url":"https://github.com/shahradelahi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"logo.svg\" alt=\"NodeVault Logo\" width=\"200\" height=\"200\"/\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n\u003csup\u003eNode Vault\u003c/sup\u003e\n\u003cbr\u003e\n\u003ca href=\"https://github.com/shahradelahi/node-vault/actions/workflows/ci.yml\" title=\"Build status\"\u003e\u003cimg src=\"https://github.com/shahradelahi/node-vault/actions/workflows/ci.yml/badge.svg\" alt=\"Build status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@litehex/node-vault\" title=\"NPM Version\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@litehex/node-vault\" alt=\"npm\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@litehex/node-vault\" title=\"Downloads\"\u003e\u003cimg alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@litehex%2Fnode-vault.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\" title=\"License\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\" alt=\"MIT Licensed\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n_node-vault_ is a Javascript HTTP client for [HashiCorp's Vault](https://developer.hashicorp.com/vault/api-docs) API\nthat allows you to have typesafe access to the API using [TypeScript](https://www.typescriptlang.org/)\nand [Zod](https://github.com/colinhacks/zod).\n\n---\n\n- [Features](#-features)\n- [Installation](#-installation)\n- [Usage](#-usage)\n  - [Init and unseal vault](#init-and-unseal-vault)\n  - [Create Key/Value V2 engine](#create-keyvalue-v2-engine)\n  - [Create, read, update, delete secrets](#write-read-and-delete-secrets)\n- [Documentation](#-documentation)\n- [Contributing](#-contributing)\n- [License](#license)\n\n## 👀 Features\n\n- Simple API\n- Typesafe and Validated Requests from Zod\n- Extendable using Custom Commands\n\n## 📦 Installation\n\n```bash\nnpm install @litehex/node-vault\n```\n\n## 📖 Usage\n\n##### Init and unseal vault\n\n```typescript\nimport { Client } from '@litehex/node-vault';\n\n// Get a new instance of the client\nconst vc = new Client({\n  apiVersion: 'v1', // default\n  endpoint: 'http://127.0.0.1:8200', // default\n  token: 'hv.xxxxxxxxxxxxxxxxxxxxx' // Optional in case you want to initialize the vault\n});\n\n// Init vault\nconst init = await vc.init({ secret_shares: 1, secret_threshold: 1 });\nconsole.log(init); // { data: { keys: [ ... ], keys_base64: [ ... ], ... } }\n\n// Set token\nconst { keys, root_token } = init;\nvc.token = root_token;\n\nconst unsealed = await vc.unseal({ key: keys[0] });\n\nconsole.log(unsealed); // { data: { type: 'shamir', initialized: true, sealed: false, ... } }\n```\n\n##### Create Key/Value V2 engine\n\n```typescript\nconst mounted = await vc.mount({\n  mountPath: 'my-secret',\n  type: 'kv-v2'\n});\n\nconsole.log(mounted); // { data: true }\n\nconst info = await vc.engineInfo({ mountPath: 'my-secret' });\n\nconsole.log(info); // { data: { type: 'kv', options: { version: '2' }, ... } }\n```\n\n##### Write, read and delete secrets\n\n```typescript\nconst mountPath = 'my-secret';\nconst path = 'hello';\n\nconst write = await vc.kv2.write({\n  mountPath,\n  path,\n  data: { foo: 'bar' }\n});\nconsole.log(write); // { data: { request_id: '...', lease_id: '...', ... } }\n\nconst read = await vc.kv2.read({ mountPath, path });\nconsole.log(read); // { data: { request_id: '...', lease_id: '...', ... } }\n\nconst deleted = await vc.kv2.deleteLatest({ mountPath, path });\nconsole.log(deleted); // { data: true }\n```\n\n### 📚 Documentation\n\nFor complete usages, please dive into the [Wiki](https://github.com/shahradelahi/node-vault/wiki).\n\nFor all configuration options, please see [the API docs](https://www.jsdocs.io/package/@litehex/node-vault).\n\n### 🤝 Contributing\n\nYou can contribute to this project by opening an issue or a pull request\non [GitHub](https://github.com/shahradelahi/node-vault). Feel free to contribute, we care about your ideas and\nsuggestions.\n\n### Relevant\n\n- HashiCorp's Vault [API docs](https://developer.hashicorp.com/vault/api-docs)\n- [Minimal CLI for K/V V2 engine](https://github.com/shahradelahi/vault-cli)\n\n### License\n\n[MIT](LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fnode-vault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahradelahi%2Fnode-vault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fnode-vault/lists"}