Early access — founding teams get the Free tier locked in permanently.
Sirr is in public beta — APIs may change before 1.0
← Back to SDKs

Node.js / TypeScript SDK

The official Sirr client for Node.js and TypeScript. First-class type definitions, tree-shakeable, and zero dependencies beyond fetch.

View on GitHub →

Installation

npm install @sirrlock/node

Or with your preferred package manager:

yarn add @sirrlock/node
pnpm add @sirrlock/node

Quick Start

import { SirrClient } from "@sirrlock/node";

const sirr = new SirrClient({
  baseUrl: "https://sirrlock.com",
  apiKey: "sirr_lic_...",
});

// Public dead drop (value only, returns id + url)
const { id, url } = await sirr.push("database_password=hunter2", {
  ttl: 3600,
  maxReads: 3,
});
console.log("Share URL:", url);

// Org named secret
await sirr.set("DB_URL", "postgres://...", {
  org: "myteam",
  ttl: 3600,
  maxReads: 3,
});

// Retrieve by ID (public) or key (org)
const secret = await sirr.get(id);
console.log("Value:", secret.value);

// Delete early
await sirr.delete(id);

Try it live

Click Run to execute this example against a real Sirr instance. The secret is created, read, and deleted in real‑time.

TypeScript
import { SirrClient } from "@sirrlock/node";

const sirr = new SirrClient({
  baseUrl: "https://sirr.sirrlock.com",
});

// Push a secret (expires in 5 min, max 3 reads)
const { id, url } = await sirr.push(
  "Hello from the Sirr sandbox!",
  { ttl: 300, maxReads: 3 },
);
console.log("Secret stored:", id);

// Retrieve the secret
const secret = await sirr.get(id);
console.log("Value:", secret.value);

// Delete early
await sirr.delete(id);
console.log("Secret deleted");

Client-Side Encryption

For high-sensitivity data, enable client-side encryption so the server never sees plaintext. The SDK handles key generation, encryption, and decryption transparently.

import { SirrClient } from "@sirrlock/node";

const sirr = new SirrClient({
  baseUrl: "https://sirrlock.com",
  apiKey: "sirr_lic_...",
  encryption: true, // enable client-side encryption
});

// Content is encrypted before leaving your machine
const { id, key } = await sirr.push("top-secret-value", { ttl: 600 });

// Share `id` and `key` separately — both are needed to decrypt
const secret = await sirr.get(id, { key });
console.log(secret.value); // "top-secret-value"

Requirements

  • Node.js 18+ (uses native fetch)
  • Also works in Bun and Deno
  • TypeScript 5.0+ recommended (full type inference)

Contribute

The Node.js SDK is open source under the MIT license. Bug reports, feature requests, and pull requests are welcome.

github.com/sirrlock/sirr-node →