Express.js SDK
Automatic outbound API monitoring for Express.js. Patches fetch, axios, and native http/https.
Installation
npm install @outbound_iq/expressSetup
Initialize at the TOP of your app, before other imports:
import express from 'express';
import { initExpress, userContextMiddleware } from '@outbound_iq/express';
const app = express();
// Initialize OutboundIQ FIRST - patches fetch/http automatically
initExpress({
apiKey: process.env.OUTBOUNDIQ_KEY
});
// Optional: Track user context
app.use(userContextMiddleware());
// Your routes - all HTTP calls are automatically tracked!
app.get('/api/payment', async (req, res) => {
const response = await fetch('https://api.stripe.com/v1/charges');
res.json(await response.json());
});
app.listen(3000);What Gets Tracked
- β
fetch() - β
axios - β
got - β
node-fetch - β Native
http.request()andhttps.request()
User Context
The middleware automatically captures req.user from auth middleware:
// Works with passport, express-jwt, or any auth middleware
app.use(passport.authenticate('session'));
app.use(userContextMiddleware()); // Add AFTER auth
// Now all API calls include user context automaticallyTest Your Integration
npx outboundiq-test