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

@hookbridge/sdk

v1.0.0

Published

Official HookBridge SDK for Node.js and TypeScript

Readme

HookBridge Node.js SDK

Official HookBridge SDK for Node.js and TypeScript. Send webhooks with guaranteed delivery, automatic retries, and full observability.

Installation

npm install @hookbridge/sdk

Quick Start

import { HookBridge } from '@hookbridge/sdk';

const hookbridge = new HookBridge({
  apiKey: 'hb_live_xxxxxxxxxxxxxxxxxxxx'
});

// Send a webhook
const result = await hookbridge.send({
  endpoint: 'https://customer.app/webhooks',
  payload: {
    event: 'order.created',
    orderId: 'ord_12345',
    amount: 99.99
  }
});

console.log('Message ID:', result.messageId);

Features

  • Guaranteed Delivery: Webhooks are stored durably before acknowledgment
  • Automatic Retries: Intelligent retry with exponential backoff
  • Idempotency: Prevent duplicate webhook sends
  • Full Observability: Query logs, metrics, and message status
  • Type Safety: Full TypeScript support with detailed types

Usage

Send a Webhook

const result = await hookbridge.send({
  endpoint: 'https://customer.app/webhooks',
  payload: { event: 'user.created', userId: 'usr_123' },
  headers: { 'X-Tenant-Id': 'tenant_abc' },
  idempotencyKey: 'user-123-created'
});

Check Message Status

const message = await hookbridge.getMessage(result.messageId);
console.log(message.status); // 'queued', 'succeeded', 'pending_retry', 'failed_permanent'

Query Delivery Logs

const logs = await hookbridge.getLogs({
  status: 'failed_permanent',
  startTime: new Date('2025-01-01'),
  limit: 100
});

for (const msg of logs.messages) {
  console.log(msg.messageId, msg.lastError);
}

Get Metrics

const metrics = await hookbridge.getMetrics('24h');
console.log(`Success rate: ${(metrics.successRate * 100).toFixed(1)}%`);
console.log(`Average latency: ${metrics.avgLatencyMs}ms`);

Replay Failed Messages

// Replay a specific message
await hookbridge.replay(messageId);

// Or replay from the Dead Letter Queue
const dlq = await hookbridge.getDLQMessages();
for (const msg of dlq.messages) {
  await hookbridge.replayFromDLQ(msg.messageId);
}

Manage Retries

// Cancel a pending retry (moves to DLQ)
await hookbridge.cancelRetry(messageId);

// Trigger immediate retry for a pending message
await hookbridge.retryNow(messageId);

API Key Management

// List API keys
const keys = await hookbridge.listAPIKeys();

// Create a new API key
const newKey = await hookbridge.createAPIKey({
  label: 'Production backend',
  mode: 'live'
});
console.log('Save this key:', newKey.key); // Only shown once!

// Delete an API key
await hookbridge.deleteAPIKey('key_abc123');

Configuration

const hookbridge = new HookBridge({
  // Required: Your API key
  apiKey: 'hb_live_xxxxxxxxxxxxxxxxxxxx',

  // Optional: Custom base URL (default: https://api.hookbridge.io)
  baseUrl: 'https://api.hookbridge.io',

  // Optional: Request timeout in ms (default: 30000)
  timeout: 30000,

  // Optional: Number of retries for failed requests (default: 3)
  retries: 3
});

Error Handling

import {
  HookBridge,
  AuthenticationError,
  ValidationError,
  RateLimitError,
  NotFoundError,
  IdempotencyError
} from '@hookbridge/sdk';

try {
  await hookbridge.send({ ... });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof ValidationError) {
    console.error('Invalid request:', error.message);
  } else if (error instanceof RateLimitError) {
    console.error(`Rate limited. Retry after ${error.retryAfter}s`);
  } else if (error instanceof IdempotencyError) {
    console.error('Duplicate request with different payload');
  } else {
    throw error;
  }
}

Webhook Delivery

When HookBridge delivers your webhook, it includes these headers:

  • X-Webhook-Signature: HMAC-SHA256 signature for verification
  • X-Webhook-Id: Message ID for tracking
  • X-Webhook-Timestamp: Unix timestamp of the send request
  • Any custom headers you specified

Retry Behavior

  • Fast retries (for 429 responses): 30s, 60s, 120s, 240s, 300s
  • Slow retries (for other errors): 30m, 2h, 6h, 12h, 24h, 48h, 72h, 96h
  • Maximum 8 total attempts before moving to the Dead Letter Queue

Requirements

  • Node.js 18.0.0 or later

License

MIT