Skip to main content

Reference

SDK Reference.

CheckUpstream SDKs instrument your application to capture outbound HTTP telemetry. They auto-detect calls to supported services and report latency, status codes, and error rates. Two SDKs are GA — Node.js and Browser. Seven more languages are in private beta and ship the same configuration surface.

Quickstart.

Pick the SDK that matches your runtime. Both GA SDKs use the same init({ sdkKey }) shape.

Installation

Bash
npm install @checkupstream/sdk

Initialization

The @checkupstream/sdk package patches globalThis.fetch so existing calls are instrumented with no per-request changes.

TypeScript
import { checkupstream } from "@checkupstream/sdk";

checkupstream.init({
  sdkKey: "cup_sdk_your_key",
});

// Your existing fetch calls are now instrumented
const response = await fetch("https://api.stripe.com/v1/charges");
// → Telemetry event: { host: "api.stripe.com", endpoint: "/v1/charges", status: 200, latency_ms: 142 }

Graceful shutdown

TypeScript
process.on("SIGTERM", async () => {
  await checkupstream.shutdown();
  process.exit(0);
});

Framework integrations: Express, Fastify, Hono, NestJS, Next.js, Nuxt, SvelteKit.

Other languages — private beta.

Seven additional SDKs are functionally complete but haven't been validated against production traffic yet. Email us with your stack and we'll reply within one business day with an SDK Key, a setup walkthrough, and direct access to the engineer who wrote the SDK. First three production deployments per language get founder-level support.

Configuration.

All SDKs share the same configuration surface. Field names use the idiomatic casing for each language (e.g. sdkKey in JS, sdk_key in Python, SDKKey in Go).

CheckUpstreamConfig
PropertyTypeStatusDefaultDescription
sdkKey
stringRequiredYour CheckUpstream SDK Key (starts with cup_sdk_). Publishable — safe to ship in client bundles. API Tokens (cup_api_*) are rejected at init.
endpoint
stringOptional"https://ingest.checkupstream.com/v1/events"Telemetry ingestion endpoint.
services
string[]OptionalundefinedRestrict monitoring to specific service slugs. If omitted, all auto-detected services are tracked.
flushIntervalMs
numberOptional10000How often to flush the telemetry batch (milliseconds).
maxBatchSize
numberOptional100Maximum events per batch before auto-flush.
enabled
booleanOptionaltrueSet to false to disable the SDK entirely (useful for test environments).

Telemetry events.

Each intercepted request generates a telemetry event. Events are batched and sent as a TelemetryBatch.

TelemetryEvent
PropertyTypeStatusDefaultDescription
host
stringRequiredRequest hostname, e.g. "api.stripe.com". The server maps hosts to services.
endpoint
stringRequiredRequest path, e.g. "/v1/charges".
status
numberRequiredHTTP status code.
latency_ms
numberRequiredRequest duration in milliseconds.
ts
numberRequiredUnix timestamp (ms).
TelemetryBatch
PropertyTypeStatusDefaultDescription
sdk_key
stringRequiredThe SDK Key (cup_sdk_*) used to authenticate the batch.
batch
TelemetryEvent[]RequiredArray of telemetry events.

Auto-detected services.

All SDKs automatically recognise outbound requests to these domains. Subdomain matching is supported (e.g. us-east-1.s3.amazonaws.com resolves to AWS S3).

DomainService
api.stripe.comStripe
api.openai.comOpenAI
api.anthropic.comAnthropic
s3.amazonaws.comAWS S3
dynamodb.amazonaws.comAWS DynamoDB
api.twilio.comTwilio
api.sendgrid.comSendGrid
api.resend.comResend
api.clerk.comClerk
api.supabase.coSupabase
api.posthog.comPostHog
api.segment.ioSegment
api.mixpanel.comMixpanel
api.algolia.comAlgolia
api.cloudinary.comCloudinary

Common patterns.

Restrict to specific services

Pass a services array to track only a subset. Requests to other hosts pass through unchanged.

TypeScript
checkupstream.init({
  sdkKey: "cup_sdk_your_key",
  services: ["stripe", "openai"],
});

Disable in tests

Tie the SDK to your environment so unit tests don't ping the ingest endpoint.

TypeScript
checkupstream.init({
  sdkKey: "cup_sdk_test_key",
  enabled: process.env.NODE_ENV === "production",
});

Instrument your app.

Drop the SDK in, point it at your project key, and start seeing live upstream telemetry inside the dashboard.