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

@pulsestack/client

v0.1.1

Published

PulseStack SDK: API key auth, healthchecks, heartbeats, and dashboard APIs for IaC and in-house dashboards

Downloads

172

Readme

pulsestack

TypeScript/JavaScript SDK for PulseStack: healthchecks and heartbeats. One API key (from API Keys in the dashboard) to create and manage healthchecks and heartbeats from code or IaC, and to build in-house dashboards.

API key and security

  • Organization-scoped: Your API key is tied to a single organization. It can only access that organization’s healthchecks and heartbeats. Use one key per organization; do not reuse the same key across organizations.
  • Create keys in the dashboard: API KeysCreate API key.

Setup

  • Create an organization in PulseStack (if needed).
  • In the dashboard go to API KeysCreate API key.
  • Set PULSESTACK_API_KEY and optionally PULSESTACK_URL. Default base URL is https://pulsestack.io/api (production).

Installation

npm install @pulsestack/client

Usage

const PulseStack = require("@pulsestack/client");

const client = PulseStack({
  baseUrl: process.env.PULSESTACK_URL || "https://pulsestack.io/api",
  apiKey: process.env.PULSESTACK_API_KEY,
});

// --- Healthchecks ---
const check = await client.ensureHealthcheck("my-api", {
  interval: 60,
  url: "https://api.example.com/health",
  method: "GET",
  timeout: 10000,
  regions: ["us-east-1"],
});
const list = await client.listHealthchecks();
await client.updateHealthcheck(check.id, { enabled: false });

// Dashboard: results graph, latest (incl. errors), SLA metrics, performance
const graph = await client.getHealthcheckResultsGraph(check.id, { range: "24h" });
const latest = await client.getHealthcheckResultsLatest(check.id, { errorsOnly: true });
const sla = await client.getHealthcheckSLAMetrics(check.id, { range: "7d" });
const perf = await client.getHealthcheckPerformance(check.id, { range: "24h" });
const templates = await client.getHealthcheckSLATemplates();

// --- Heartbeats ---
const { uuid, pingUrl } = await client.ensureHeartbeat({
  name: "daily-backup",
  expectedIntervalSeconds: 86400,
  gracePeriodSeconds: 3600,
});
await client.ping(uuid);
await client.ping(uuid, { duration: 1200, source: process.env.HOSTNAME });

const heartbeats = await client.listHeartbeats({ includeLastPingSource: true });
const h = await client.getHeartbeat(heartbeats[0].id);
const history = await client.getHeartbeatHistory(h.id, { range: "7d" });

TypeScript / ESM

import PulseStack from "@pulsestack/client";
import type { HealthcheckListItem, Heartbeat } from "@pulsestack/client";

const client = PulseStack({ apiKey: process.env.PULSESTACK_API_KEY });
const list: HealthcheckListItem[] = await client.listHealthchecks();

Terraform / IaC

Use the HTTP provider or null_resource + local-exec with curl or this SDK.

Option 1: curl (no Node)

variable "pulsestack_api_key" {
  type      = string
  sensitive = true
}
variable "pulsestack_url" {
  type    = string
  default = "https://pulsestack.io/api"
}

resource "null_resource" "pulsestack_healthcheck" {
  provisioner "local-exec" {
    command = <<-EOT
      curl -s -X POST "${var.pulsestack_url}/healthchecks" \
        -H "Authorization: Bearer ${var.pulsestack_api_key}" \
        -H "Content-Type: application/json" \
        -d '{"name":"my-api","enabled":true,"config":{"interval":60,"request":{"method":"GET","url":"https://api.example.com/health","timeout":10000},"regions":["us-east-1"]}}'
    EOT
  }
}

Option 2: SDK (@pulsestack/client)

Ensure the package is installed (e.g. in a wrapper script or npm install @pulsestack/client in local-exec). Then:

resource "null_resource" "pulsestack_healthcheck_sdk" {
  provisioner "local-exec" {
    command     = "node -e \"const p=require('@pulsestack/client');(async()=>{const c=p({apiKey:process.env.PULSESTACK_API_KEY,baseUrl:process.env.PULSESTACK_URL});await c.ensureHealthcheck('my-api',{interval:60,url:'https://api.example.com/health',regions:['us-east-1']});})();\""
    environment = {
      PULSESTACK_API_KEY = var.pulsestack_api_key
      PULSESTACK_URL     = var.pulsestack_url
    }
  }
}

Do not commit API keys; use TF_VAR_pulsestack_api_key, a secrets backend, or Terraform Cloud variables.