Skip to main content
All recipes

Sentry

CodeNode.jsDelivery errors

Forward SDK delivery errors to Sentry with the onError hook. The exception describes a problem sending telemetry; it does not establish that an upstream vendor request failed.

Forward SDK errors into Sentry

instrumentation.ts
import * as Sentry from "@sentry/node";
import { initCheckUpstream } from "@checkupstream/sdk/integrations/next";

export function register() {
  const sdkKey = process.env.CHECKUPSTREAM_SDK_KEY;
  if (!sdkKey) throw new Error("Set CHECKUPSTREAM_SDK_KEY before starting the app");

  initCheckUpstream({
    sdkKey,
    onError: (error) => {
      Sentry.captureException(error, {
        tags: {
          source: "checkupstream-sdk",
        },
      });
    },
  });
}

Continue your setup

Check runtime availability and credentials before deploying an integration.