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.
SDK availability
@checkupstream/sdk 0.1.0 is on npm and records requests made with fetch. The browser package is not published; contact us for access. Check the SDK reference for your runtime and review what the SDK sends.1. Install
Bash
npm install @checkupstream/sdk2. 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.
Related
Continue your setup
Check runtime availability and credentials before deploying an integration.