Node.js SDKFrameworks
Hono
Apply the Trasys SDK's middleware to every route in a Hono application with app.use('*', sdk.honoMiddleware()) to automatically capture request spans.
Hono
// index.js
require('dotenv').config();
const { sdk } = require('./trasys'); // SDK must be required first
const { Hono } = require('hono');
const app = new Hono();
// Apply to all routes using '*'
app.use('*', sdk.honoMiddleware());
app.get('/users/:id', async (c) => {
const user = await db.findUser(c.req.param('id'));
return c.json(user);
});
export default app;TypeScript
// index.ts
import 'dotenv/config';
import { sdk } from './trasys';
import { Hono } from 'hono';
const app = new Hono();
app.use('*', sdk.honoMiddleware());
app.get('/users/:id', async (c) => {
const user = await db.findUser(c.req.param('id'));
return c.json(user);
});
export default app;Scoped middleware
Apply the middleware only to specific route groups by using a path prefix instead of '*':
// Apply only to /api/* routes
app.use('/api/*', sdk.honoMiddleware());Bun + Hono
Hono is commonly used with Bun. The middleware works normally on Bun, but outbound HTTP spans are not available due to a platform limitation.
// Bun entry point
import 'dotenv/config';
import { sdk } from './trasys';
import { Hono } from 'hono';
const app = new Hono();
app.use('*', sdk.honoMiddleware());
// Routes here...
export default {
port: 3000,
fetch: app.fetch,
};Next steps
- Logging — add structured logging correlated to each request
- Session Tracking — link requests to users and sessions
- Distributed Tracing — connect traces across services
Fastify
Register the Trasys SDK's Fastify plugin before your routes to automatically capture every inbound request as a span using sdk.fastifyplugin() at startup.
NestJS
Instrument a NestJS application on either the Express or Fastify adapter by applying the Trasys SDK middleware in main.ts before the app starts listening.

