Node.js Core SDK
The core JavaScript SDK for Node.js applications. Use this for plain Node.js or custom frameworks.
Installation
npm install @outbound_iq/coreSetup
Initialize at the TOP of your application:
import { register } from '@outbound_iq/core/node';
// Initialize FIRST - before any other code
register({
apiKey: process.env.OUTBOUNDIQ_KEY
});
// Now all HTTP calls are automatically tracked!
const response = await fetch('https://api.stripe.com/v1/charges');
const data = await response.json();Configuration
register({
apiKey: process.env.OUTBOUNDIQ_KEY,
debug: true, // Enable debug logging
batchSize: 10, // Flush after N calls
flushInterval: 5000, // Flush every 5 seconds
timeout: 5000, // Timeout for sending metrics
});Manual Tracking
import { track, setUserContext } from '@outbound_iq/core';
// Set user context for subsequent calls
setUserContext({
userId: '123',
userType: 'Customer',
context: 'authenticated',
});
// Manually track a call (rarely needed)
track({
method: 'POST',
url: 'https://api.example.com/data',
statusCode: 200,
duration: 150,
});Test Your Integration
npx outboundiq-test