Skip to main content

Integration Guides

Recipes.

Copy-paste snippets for common integrations. Get up and running in minutes.

CheckUpstream + Sentry

Report upstream dependency errors to Sentry using the onError callback.

import * as Sentry from "@sentry/node";
import { checkupstream } from "@checkupstream/sdk";

checkupstream.init({
  apiKey: process.env.CHECKUPSTREAM_API_KEY,
  onError: (error, context) => {
    Sentry.captureException(error, {
      tags: {
        upstream_service: context.service,
        upstream_status: context.status,
      },
    });
  },
});
typescript

CheckUpstream + PagerDuty

Forward incident alerts to PagerDuty via webhook integration.

// In your Dashboard → Settings → Webhooks, add:
// URL: https://events.pagerduty.com/integration/
//      <YOUR_INTEGRATION_KEY>/enqueue
//
// Or use the API:
await fetch("/api/v1/webhooks", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer cup_...",
  },
  body: JSON.stringify({
    url: "https://events.pagerduty.com/integration/<KEY>/enqueue",
    events: ["incident.created", "incident.updated"],
    secret: "your-webhook-secret",
  }),
});
typescript

CheckUpstream + Slack

Get real-time notifications in Slack when upstream services degrade.

// 1. Go to Dashboard → Settings → Integrations
// 2. Click "Add to Slack"
// 3. Select a channel for notifications
// 4. Choose which events to receive:

// Supported events:
//   - incident.created    → New incident detected
//   - incident.resolved   → Incident resolved
//   - service.degraded    → Service degradation
//   - dependency.risk_changed → Risk score change

// Or configure via API:
await fetch("/api/v1/integrations/slack", {
  method: "POST",
  headers: { Authorization: "Bearer cup_..." },
  body: JSON.stringify({
    channel: "#ops-alerts",
    events: ["incident.created", "service.degraded"],
  }),
});
typescript

CheckUpstream + Next.js

Use the after() pattern to flush telemetry without blocking the response in serverless.

import { after } from "next/server";
import { checkupstream } from "@checkupstream/sdk";

checkupstream.init({
  apiKey: process.env.CHECKUPSTREAM_API_KEY,
});

export async function GET() {
  const data = await fetchUpstreamService();

  // Flush telemetry after the response is sent
  after(async () => {
    await checkupstream.flush();
  });

  return Response.json(data);
}
typescript

CheckUpstream + Express

Drop-in Express middleware that tracks upstream latency and errors.

import express from "express";
import { checkupstream } from "@checkupstream/sdk";
import { expressMiddleware } from "@checkupstream/sdk/express";

const app = express();

checkupstream.init({
  apiKey: process.env.CHECKUPSTREAM_API_KEY,
});

// Add middleware — tracks all outgoing HTTP calls
app.use(expressMiddleware());

app.get("/api/users", async (req, res) => {
  // Calls to Stripe, OpenAI, etc. are
  // automatically tracked
  const users = await db.getUsers();
  res.json(users);
});

app.listen(3000);
typescript

CheckUpstream + GitHub Actions

Run a dependency health check in CI before deploying.

name: Dependency Health Check
on:
  pull_request:
    branches: [main]
  schedule:
    - cron: "0 8 * * 1" # Weekly Monday 8am

jobs:
  check-upstream:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run CheckUpstream scan
        run: npx @checkupstream/cli scan
        env:
          CHECKUPSTREAM_API_KEY: ${{ secrets.CHECKUPSTREAM_API_KEY }}

      - name: Check for critical risks
        run: npx @checkupstream/cli risk --fail-on critical
        env:
          CHECKUPSTREAM_API_KEY: ${{ secrets.CHECKUPSTREAM_API_KEY }}
yaml

Need a different integration?

We support 12 alert channels and 8 language SDKs. Check the full docs or open a request.