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

@devhelm/sdk

v1.5.0

Published

DevHelm SDK for TypeScript and JavaScript — typed client for monitors, incidents, alerting, and more

Readme

DevHelm JavaScript / TypeScript SDK

Typed JavaScript / TypeScript client for the DevHelm monitoring API — monitors, incidents, alerting, and more. Works in Node.js 18+ and modern bundlers; ships with full TypeScript types.

Installation

npm install @devhelm/sdk

Quick Start

import {Devhelm} from '@devhelm/sdk'

const client = new Devhelm({
  token: 'your-api-token',
  orgId: 'your-org-id',
  workspaceId: 'your-workspace-id',
})

// List all monitors
const monitors = await client.monitors.list()
for (const m of monitors) {
  console.log(`${m.name} — ${m.type}`)
}

// Create a monitor
const monitor = await client.monitors.create({
  name: 'My API Health',
  type: 'HTTP',
  config: {url: 'https://api.example.com/health', method: 'GET'},
  frequencySeconds: 60,
  regions: ['us-east'],
  // `managedBy` records who reconciles drift. `DASHBOARD` (default) means
  // "no reconciliation" — the right answer for one-off scripts and most
  // SDK use. Use `CLI` if this monitor lives in a `devhelm.yml` you
  // re-deploy, or `TERRAFORM` if it lives in `.tf` you re-apply.
  managedBy: 'DASHBOARD',
})
// Note: `monitor.currentStatus` is null until the first probe runs (~1 minute); display `monitor.currentStatus ?? 'PENDING'`.

// Get a single monitor
const fetched = await client.monitors.get(monitor.id)

// Pause / resume
await client.monitors.pause(monitor.id)
await client.monitors.resume(monitor.id)

// Delete
await client.monitors.delete(monitor.id)

Configuration

import {Devhelm} from '@devhelm/sdk'

const client = new Devhelm({
  token: 'your-api-token',           // required (or DEVHELM_API_TOKEN env var)
  orgId: '1',                        // optional (or DEVHELM_ORG_ID; defaults to '1')
  workspaceId: '1',                  // optional (or DEVHELM_WORKSPACE_ID; defaults to '1')
  baseUrl: 'https://api.devhelm.io', // optional, defaults to production
})

Environment variables are used as fallbacks when constructor arguments are not provided:

| Parameter | Env Variable | | ------------- | ---------------------- | | token | DEVHELM_API_TOKEN | | orgId | DEVHELM_ORG_ID | | workspaceId | DEVHELM_WORKSPACE_ID |

Resources

The client exposes the following resource modules:

| Resource | Description | | ------------------------------ | ---------------------------------------------------------- | | client.monitors | HTTP, DNS, TCP, ICMP, MCP, and Heartbeat monitors | | client.incidents | Manual and auto-detected incidents | | client.forensics | Per-monitor rule evaluations, transitions, and policy snapshots | | client.alertChannels | Slack, email, webhook, and other alert channels | | client.notificationPolicies | Routing rules for alerts | | client.environments | Environment grouping (prod, staging, etc.) | | client.secrets | Encrypted secrets for monitor auth | | client.tags | Organize monitors with tags | | client.resourceGroups | Logical resource groups | | client.webhooks | Outgoing webhook endpoints | | client.apiKeys | API key management | | client.dependencies | Service dependency tracking | | client.services | Status Data catalog (third-party service status, incidents, uptime) | | client.deployLock | Deploy lock for safe deployments | | client.statusPages | Public status page management | | client.status | Dashboard overview |

Pagination

List methods auto-paginate by default. For manual page control:

// Auto-paginate (fetches all pages)
const allMonitors = await client.monitors.list()

// Manual page control
const page = await client.monitors.listPage(0, 20)
console.log(page.data)     // array of monitors
console.log(page.hasNext)  // true if more pages
console.log(page.hasPrev)  // true if previous page exists

// Cursor pagination (for check results)
const results = await client.monitors.results(monitorId, {limit: 50})
console.log(results.data)
console.log(results.nextCursor)
console.log(results.hasMore)

Error Handling

The SDK raises three top-level error types:

  • DevhelmValidationError — local request/response shape validation failed.
  • DevhelmApiError — the API returned a non-2xx status. Subclassed by HTTP class for ergonomics:
    • DevhelmAuthError (401/403)
    • DevhelmNotFoundError (404)
    • DevhelmConflictError (409)
    • DevhelmRateLimitError (429)
    • DevhelmServerError (5xx)
  • DevhelmTransportError — the request never reached a server response (connection refused, timeout, TLS failure, etc.).

Every DevhelmApiError carries:

  • status — the HTTP status code
  • code — coarse machine-readable category (e.g. NOT_FOUND, RATE_LIMITED); switch on this, not the human-readable message
  • requestId — the per-request id from the X-Request-Id response header; always include this in support tickets
import {Devhelm, DevhelmAuthError, DevhelmError} from '@devhelm/sdk'

const client = new Devhelm({token: 'bad-token', orgId: '1', workspaceId: '1'})

try {
  await client.monitors.list()
} catch (e) {
  if (e instanceof DevhelmAuthError) {
    console.log(`Auth failed: ${e.message} (HTTP ${e.status}, requestId=${e.requestId})`)
  } else if (e instanceof DevhelmError) {
    console.log(`API error [${e.code}]: ${e.message}`)
  } else {
    throw e
  }
}

TypeScript

All resource methods return strongly-typed responses. DTOs are re-exported from the package root:

import {
  Devhelm,
  type MonitorDto,
  type IncidentDto,
  type CreateMonitorRequest,
} from '@devhelm/sdk'

const client = new Devhelm({token: process.env.DEVHELM_API_TOKEN!})
const monitors: MonitorDto[] = await client.monitors.list()

Strict-mode TypeScript and ESM are first-class — the package ships ESM-only with named exports map.

Compatibility

  • Node.js ≥ 18 (uses native fetch)
  • Browser bundlers (Vite, Webpack, esbuild, Rollup) — works with the same ESM build
  • Cloudflare Workers — works (uses native fetch)

The client sends X-DevHelm-Surface: sdk-js and X-DevHelm-Surface-Version: <package version> on every request so the API can attribute traffic and warn you if your version is end-of-life. See Surface Support Policy.

License

MIT