# @bitwarden/sdk-napi

> Node-API bindings for interacting with the Bitwarden Secrets Manager. This is a beta release and might be missing some functionality.

Latest version **1.0.0** (published 2024-09-30) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @bitwarden/sdk-napi
pnpm add @bitwarden/sdk-napi
yarn add @bitwarden/sdk-napi
bun add @bitwarden/sdk-napi
```

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-09-30 |
| First published | 2023-02-01 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 0 |
| Unpacked size | 132.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 473 |
| Author | Bitwarden Inc. |
| Maintainers | racostabw, mchecinskibw, kspearrin |

## Links

- npm: https://www.npmjs.com/package/@bitwarden/sdk-napi
- Repository: https://github.com/bitwarden/sdk
- Homepage: https://github.com/bitwarden/sdk#readme
- Issues: https://github.com/bitwarden/sdk/issues
- npm.io page: https://npm.io/package/@bitwarden/sdk-napi

## Recent versions

- 1.0.0 (latest) — 2024-09-30
- 0.3.1 — 2023-10-13
- 0.3.0 — 2023-07-26
- 0.2.1 — 2023-03-22
- 0.2.0 — 2023-03-20
- 0.1.6 — 2023-02-23
- 0.1.5 — 2023-02-22
- 0.1.3 — 2023-02-21
- 0.1.2 — 2023-02-01

## README

## Bitwarden Secrets Manager SDK

Node-API bindings for interacting with the Bitwarden Secrets Manager. This is a beta release and
might be missing some functionality.

## Getting started

```ts
import { BitwardenClient, ClientSettings, DeviceType, LogLevel } from "@bitwarden/sdk-napi";

// Optional settings
const settings: ClientSettings = {
  apiUrl: "https://api.bitwarden.com",
  identityUrl: "https://identity.bitwarden.com",
  userAgent: "Bitwarden SDK",
  deviceType: DeviceType.SDK,
};

const accessToken = "-- REDACTED --";
const stateFile = "some/path/to/state/file";

const client = new BitwardenClient(settings, LogLevel.Info);

// Authenticating using a machine account access token
await client.auth().loginAccessToken(accessToken, stateFile);

// List secrets
const secrets = await client.secrets().list();

// Get a specific secret
const secret = await client.secrets().get("secret-id");
```

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