Skip to content

Files

Latest commit

63ac2f7 ยท Dec 17, 2024

History

History

bitwarden-napi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 17, 2024
Sep 19, 2024
Feb 8, 2024
Mar 20, 2023
Oct 1, 2024
Sep 19, 2024
Aug 8, 2024
Aug 8, 2024
Mar 20, 2023
Sep 25, 2024
Dec 17, 2024
Feb 5, 2024

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

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");