Skip to main content
The @devhelm/sdk package provides a typed client for the DevHelm API in Node.js and browser environments.

Install

npm install @devhelm/sdk

Initialize

import { DevHelm } from "@devhelm/sdk";

const client = new DevHelm({
  apiToken: process.env.DEVHELM_API_TOKEN,
});

Create a monitor

const monitor = await client.monitors.create({
  name: "API Health",
  type: "HTTP",
  config: {
    url: "https://api.example.com/health",
    method: "GET",
  },
  frequencySeconds: 60,
  regions: ["us-east", "eu-west"],
});

console.log(`Created monitor: ${monitor.id}`);

List monitors

const monitors = await client.monitors.list({
  page: 0,
  size: 50,
});

for (const monitor of monitors.data) {
  console.log(`${monitor.name}: ${monitor.status}`);
}

Get check results

const results = await client.monitors.checkResults(monitor.id, {
  limit: 10,
});

for (const check of results.data) {
  console.log(`${check.region}: ${check.passed ? "✓" : "✗"} (${check.responseTimeMs}ms)`);
}

Manage incidents

// List active incidents
const incidents = await client.incidents.list({
  status: "CONFIRMED",
});

// Resolve an incident
await client.incidents.resolve(incidentId);

Create an alert channel

const channel = await client.alertChannels.create({
  name: "Slack Alerts",
  config: {
    channelType: "slack",
    webhookUrl: process.env.SLACK_WEBHOOK_URL,
  },
});

Error handling

import { DevHelmError } from "@devhelm/sdk";

try {
  await client.monitors.get("nonexistent-id");
} catch (error) {
  if (error instanceof DevHelmError) {
    console.error(`${error.status}: ${error.message}`);
  }
}

Resource namespaces

The client organizes API resources into namespaces:
NamespaceResources
client.monitorsMonitors, check results, assertions
client.incidentsIncidents
client.alertChannelsAlert channels
client.notificationPoliciesNotification policies
client.tagsTags
client.environmentsEnvironments
client.webhooksWebhook endpoints
client.resourceGroupsResource groups
client.apiKeysAPI keys
client.servicesStatus data services

Next steps

API Reference

Full endpoint reference with request/response schemas.

Error handling

Error response format and common scenarios.