Skip to content

Checkly Client

@theholocron/checkly-client wraps the Checkly REST API for provisioning API checks.

Terminal window
pnpm add @theholocron/checkly-client
import { createChecklyClient } from "@theholocron/checkly-client";
const client = createChecklyClient({
token: process.env.CHECKLY_API_KEY!,
accountId: process.env.CHECKLY_ACCOUNT_ID!,
});
const existing = await client.checks.list({ search: "sentinel webhook" });
// shouldFail: true is required whenever the "healthy" response is
// itself an HTTP error status -- without it, Checkly treats any
// 4xx/5xx as a failure before your assertions are evaluated.
const check = await client.checks.create({
name: "Sentinel webhook uptime",
frequency: 5,
locations: ["us-east-1"],
tags: ["sentinel"], // what a dashboard or a status page picks the check by
shouldFail: true,
request: {
url: "https://sentinel.theholocron.dev/api/webhook",
method: "GET",
assertions: [{ source: "STATUS_CODE", comparison: "EQUALS", target: "405" }],
},
});

The full API reference is generated from the package’s TSDoc comments.