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
npm install @checkupstream/sdkInitialization
The @checkupstream/sdk package patches globalThis.fetch so existing calls are instrumented with no per-request changes.
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
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.
- PythonBetaDjango · FastAPI · Flaskrequests · httpx · urllib3Request access
- GoBetanet/http · Gin · Echo · Fiber · Chihttp.Transport wrapperRequest access
- RustBetaAxum · Actix-web · Rocketreqwest::Client wrapperRequest access
- RubyBetaRails · Sinatra · HanamiNet::HTTPRequest access
- PHPBetaLaravel · Symfony · SlimGuzzle middlewareRequest access
- JavaBetaSpring Boot · Quarkus · Micronautinstrumented HttpClient wrapperRequest access
- .NETBetaASP.NET Core · MVC · Minimal APIDelegatingHandler via IHttpClientFactoryRequest access
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| Property | Type | Status | Default | Description |
|---|---|---|---|---|
sdkKey | string | Required | — | Your CheckUpstream SDK Key (starts with cup_sdk_). Publishable — safe to ship in client bundles. API Tokens (cup_api_*) are rejected at init. |
endpoint | string | Optional | "https://ingest.checkupstream.com/v1/events" | Telemetry ingestion endpoint. |
services | string[] | Optional | undefined | Restrict monitoring to specific service slugs. If omitted, all auto-detected services are tracked. |
flushIntervalMs | number | Optional | 10000 | How often to flush the telemetry batch (milliseconds). |
maxBatchSize | number | Optional | 100 | Maximum events per batch before auto-flush. |
enabled | boolean | Optional | true | Set 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| Property | Type | Status | Default | Description |
|---|---|---|---|---|
host | string | Required | — | Request hostname, e.g. "api.stripe.com". The server maps hosts to services. |
endpoint | string | Required | — | Request path, e.g. "/v1/charges". |
status | number | Required | — | HTTP status code. |
latency_ms | number | Required | — | Request duration in milliseconds. |
ts | number | Required | — | Unix timestamp (ms). |
TelemetryBatch| Property | Type | Status | Default | Description |
|---|---|---|---|---|
sdk_key | string | Required | — | The SDK Key (cup_sdk_*) used to authenticate the batch. |
batch | TelemetryEvent[] | Required | — | Array 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).
| Domain | Service |
|---|---|
api.stripe.com | Stripe |
api.openai.com | OpenAI |
api.anthropic.com | Anthropic |
s3.amazonaws.com | AWS S3 |
dynamodb.amazonaws.com | AWS DynamoDB |
api.twilio.com | Twilio |
api.sendgrid.com | SendGrid |
api.resend.com | Resend |
api.clerk.com | Clerk |
api.supabase.co | Supabase |
api.posthog.com | PostHog |
api.segment.io | Segment |
api.mixpanel.com | Mixpanel |
api.algolia.com | Algolia |
api.cloudinary.com | Cloudinary |
Common patterns.
Restrict to specific services
Pass a services array to track only a subset. Requests to other hosts pass through unchanged.
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.
checkupstream.init({
sdkKey: "cup_sdk_test_key",
enabled: process.env.NODE_ENV === "production",
});The SDK refuses to initialise if you accidentally pass an API Token (cup_api_*) where an SDK Key (cup_sdk_*) is expected. The safest pattern is reading the key from env, never embedding either token in source.
Instrument your app.
Drop the SDK in, point it at your project key, and start seeing live upstream telemetry inside the dashboard.