All recipes
Hono.
CodeMiddlewareEdge
Hono's tiny middleware contract is a perfect fit for the SDK. Mount once, ship to any runtime — the same code runs on Cloudflare Workers, Bun, Deno, and Node.js.
1. Install.
Bash
npm install @checkupstream/sdk2. Mount the middleware.
src/index.ts
import { Hono } from "hono";
import { checkUpstreamMiddleware } from "@checkupstream/sdk/integrations/hono";
const app = new Hono();
app.use(
"*",
checkUpstreamMiddleware({
sdkKey: process.env.CHECKUPSTREAM_SDK_KEY!,
}),
);
app.get("/api/users", async (c) => c.json(await fetchUsers()));
export default app;Note
On Cloudflare Workers, read the SDK Key from `c.env.CHECKUPSTREAM_SDK_KEY` instead of `process.env` — Workers don't expose Node's `process` global.
Related
Ship reliable upstream.
Drop the SDK in, point it at your project key, and start seeing live upstream telemetry inside the dashboard.