Skip to main content
All recipes

NestJS

CodeModuleInterceptor

Import the CheckUpstream dynamic module to initialize outbound fetch monitoring. This integration does not attach controller or handler context to requests.

1. Install

Bash
npm install @checkupstream/sdk

2. Import the dynamic module

src/app.module.ts
import { Module } from "@nestjs/common";
import { registerCheckUpstream } from "@checkupstream/sdk/integrations/nestjs";

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

@Module({
  imports: [registerCheckUpstream({ sdkKey })],
})
export class AppModule {}

3. Flush during shutdown

Await checkupstream.shutdown() in your application's shutdown lifecycle before exiting. The module initializes the SDK; it does not register a Nest shutdown provider.

Continue your setup

Check runtime availability and credentials before deploying an integration.