Express.js SDK

Automatic outbound API monitoring for Express.js. Patches fetch, axios, and native http/https.

Installation

npm install @outbound_iq/express

Setup

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() and https.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 automatically

Test Your Integration

npx outboundiq-test
Express.js SDK | OutboundIQ Docs