Skip to main content
All recipes

Fastify.

CodePluginNode.js

Fastify's plugin system handles SDK initialization on `server.ready()` and graceful flushing on `onClose`. Drop the plugin in once and forget about it.

1. Install.

Bash
npm install @checkupstream/sdk

2. Register the plugin.

server.ts
import Fastify from "fastify";
import { checkUpstreamPlugin } from "@checkupstream/sdk/integrations/fastify";

const app = Fastify();

await app.register(checkUpstreamPlugin, {
  sdkKey: process.env.CHECKUPSTREAM_SDK_KEY!,
});

app.get("/api/users", async () => fetchUsers());

await app.listen({ port: 3000 });

Ship reliable upstream.

Drop the SDK in, point it at your project key, and start seeing live upstream telemetry inside the dashboard.