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 access required
Node.js and browser packages are not on public npm yet. Contact us for access before following the installation steps. 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.