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

@abxy/tripwire-server

v0.2.1

Published

Official Tripwire Node server SDK

Readme

Tripwire Node Library

Preview Node 18+ License: MIT

The Tripwire Node library provides convenient access to the Tripwire API from applications running in Node.js. It includes a typed client for Sessions, Fingerprints, Teams, Team API key management, sealed token verification, Gate, and Gate delivery/webhook helpers.

The library also provides:

  • a fast configuration path using TRIPWIRE_SECRET_KEY
  • helpers for cursor-based pagination
  • structured API errors and built-in sealed token verification
  • public, bearer-token, and secret-key auth modes for Gate flows
  • Gate delivery/webhook helpers

Documentation

See the Tripwire docs and API reference.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, run:

npm install @abxy/tripwire-server

Requirements

  • Node 18+

Usage

Use TRIPWIRE_SECRET_KEY or an explicit secretKey for core detect APIs. For public or bearer-auth Gate flows, the client can also be constructed without a secret key:

import { Tripwire } from "@abxy/tripwire-server";

const client = new Tripwire({
  secretKey: process.env.TRIPWIRE_SECRET_KEY,
});

const page = await client.sessions.list({ verdict: "bot", limit: 25 });
const session = await client.sessions.get("sid_123");

console.log(page.has_more, page.next_cursor);
console.log(session.decision.risk_score, session.highlights[0]?.summary);

Sealed token verification

import { safeVerifyTripwireToken } from "@abxy/tripwire-server";

const result = safeVerifyTripwireToken(
  sealedToken,
  process.env.TRIPWIRE_SECRET_KEY,
);

if (!result.ok) {
  console.error(result.error);
  return;
}

console.log(result.data.decision.verdict, result.data.decision.risk_score);

Pagination

for await (const session of client.sessions.iter({ search: "signup" })) {
  console.log(session.id, session.latest_decision.verdict);
}

Fingerprints

const page = await client.fingerprints.list({ sort: "seen_count" });
const fingerprint = await client.fingerprints.get("vid_123");

console.log(fingerprint.lifecycle.last_seen_at);

Teams

const team = await client.teams.get("team_123");
const updated = await client.teams.update("team_123", { name: "New Name" });

Team API keys

const created = await client.teams.apiKeys.create("team_123", {
  name: "Production",
  environment: "live",
  allowed_origins: ["https://example.com"],
});

await client.teams.apiKeys.revoke("team_123", created.id);

Gate APIs

const client = new Tripwire();

const services = await client.gate.registry.list();
const session = await client.gate.sessions.create({
  service_id: "tripwire",
  account_name: "my-project",
  delivery: createDeliveryKeyPair().delivery,
});

console.log(services[0]?.id, session.consent_url);

Gate delivery and webhook helpers

import {
  createDeliveryKeyPair,
  createGateApprovedWebhookResponse,
  decryptGateDeliveryEnvelope,
  verifyGateWebhookSignature,
} from "@abxy/tripwire-server";

const keyPair = createDeliveryKeyPair();
const response = createGateApprovedWebhookResponse({
  delivery: keyPair.delivery,
  outputs: {
    TRIPWIRE_PUBLISHABLE_KEY: "pk_live_...",
    TRIPWIRE_SECRET_KEY: "sk_live_...",
  },
});

const payload = decryptGateDeliveryEnvelope(keyPair.privateKey, response.encrypted_delivery);
console.log(payload.outputs.TRIPWIRE_SECRET_KEY);

console.log(verifyGateWebhookSignature({
  secret: "whsec_test",
  timestamp: "1735776000",
  rawBody: "{\"event\":\"gate.session.approved\"}",
  signature: "…",
}));

Error handling

import { TripwireApiError } from "@abxy/tripwire-server";

try {
  await client.sessions.list({ limit: 999 });
} catch (error) {
  if (error instanceof TripwireApiError) {
    console.error(error.status, error.code, error.message);
  }
}

Support

If you need help integrating Tripwire, start with tripwirejs.com/docs.