open-index/open-npm huggingface dataset:
npm package: @outbound_iq/core
Description: OutboundIQ JavaScript SDK - Track and monitor your outbound API calls
Author: OutboundIQ
Latest version: 0.1.1

# @outboundiq/core

Core JavaScript SDK for OutboundIQ - Third-party API monitoring and analytics.

This is the base package used by framework-specific SDKs like `@outboundiq/nextjs` and `@outboundiq/express`.

## Installation

```bash
npm install @outboundiq/core
```

## Quick Start

### Node.js (Automatic Tracking)

```typescript
import { registerFromEnv } from '@outboundiq/core/node';

// Initialize from environment and patch http/https
registerFromEnv();

// Now all HTTP requests are automatically tracked
await fetch('https://api.stripe.com/v1/charges');
await axios.get('https://api.twilio.com/messages');
```

### Manual Tracking

```typescript
import { init, track } from '@outboundiq/core';

init({ apiKey: process.env.OUTBOUNDIQ_KEY });

track({
  method: 'POST',
  url: 'https://api.stripe.com/v1/charges',
  statusCode: 200,
  duration: 150,
});
```

## Configuration

Add to your `.env` file:

```bash
# Required - your API key from OutboundIQ dashboard
OUTBOUNDIQ_KEY=your-api-key

# Custom endpoint URL (optional)
OUTBOUNDIQ_URL=https://agent.outboundiq.dev/api/metric

# Enable debug logging (optional)
OUTBOUNDIQ_DEBUG=true
```

## Framework SDKs

For the best experience, use the framework-specific SDK:

- **Next.js**: `@outboundiq/nextjs`
- **Express**: `@outboundiq/express`

## License

MIT
npm package: @outbound_iq/express
Description: OutboundIQ SDK for Express.js - Automatic outbound API monitoring
Author: OutboundIQ
Latest version: 0.1.0

# @outbound_iq/express

Express.js integration for OutboundIQ - Third-party API monitoring and analytics.

## Installation

```bash
npm install @outbound_iq/express
```

## Quick Start

```javascript
const express = require('express');
const { initExpress, userContextMiddleware } = require('@outbound_iq/express');

const app = express();

// Initialize OutboundIQ - patches fetch/http automatically
initExpress({ apiKey: process.env.OUTBOUNDIQ_KEY });

// Optional: track which user made each API call
app.use(userContextMiddleware());

// Your routes - no changes needed!
app.get('/api/payment', async (req, res) => {
  // This fetch is automatically tracked
  const result = await fetch('https://api.stripe.com/v1/charges');
  res.json(await result.json());
});

app.listen(3000);
```

## How It Works

OutboundIQ automatically monitors all HTTP requests made using `fetch()`, `axios`, `got`, `node-fetch`, or native `http.request()`.

## Configuration

Add to your `.env` file:

```bash
# Required - your API key from OutboundIQ dashboard
OUTBOUNDIQ_KEY=your-api-key

# Custom endpoint URL (optional)
OUTBOUNDIQ_URL=https://agent.outboundiq.dev/api/metric

# Enable debug logging (optional)
OUTBOUNDIQ_DEBUG=true
```

## User Context Tracking

Track which user made each API call:

```javascript
app.use(passport.authenticate('session'));
app.use(userContextMiddleware()); // Add after auth middleware

// Now all API calls include user context automatically
```

For webhooks or system operations:

```javascript
const { setRequestUserContext } = require('@outbound_iq/express');

app.post('/webhook/stripe', (req, res) => {
  setRequestUserContext(req, {
    userId: req.body.customer_id,
    context: 'webhook',
  });
  
  // API calls now have this context
  await fetch('https://api.internal.com/process');
  res.sendStatus(200);
});
```

## License

MIT
npm package: @outboxy/migrations
Description: Database migrations for Outboxy
Author: Outboxy Team
Latest version: 0.2.0

# @outboxy/migrations

Database migration runner for Outboxy. Creates the outbox and inbox tables, indexes, and tracking infrastructure needed by `@outboxy/sdk` and the Outboxy worker.

## Installation

```bash
npm install @outboxy/migrations
```

Install the driver for your database:

```bash
# PostgreSQL
npm install pg

# MySQL
npm install mysql2
```

## Usage

### PostgreSQL

```typescript
import { runMigrations } from "@outboxy/migrations";

await runMigrations(process.env.DATABASE_URL);
```

### MySQL

```typescript
import { runMigrations } from "@outboxy/migrations";

await runMigrations(process.env.DATABASE_URL, "mysql");
```

### Checking Migration Status

```typescript
import { getMigrationStatus } from "@outboxy/migrations";

const status = await getMigrationStatus(process.env.DATABASE_URL);
console.log(
  `Applied: ${status.applied.length}, Pending: ${status.pending.length}`,
);
```

## API

### `runMigrations(connectionString, dialect?)`

Applies all pending migrations to the database.

| Parameter          | Type      | Default        | Description                |
| ------------------ | --------- | -------------- | -------------------------- |
| `connectionString` | `string`  | —              | Database connection string |
| `dialect`          | `Dialect` | `"postgresql"` | Database dialect           |

### `getMigrationStatus(connectionString, dialect?)`

Returns the current migration status.

| Parameter          | Type      | Default        | Description                |
| ------------------ | --------- | -------------- | -------------------------- |
| `connectionString` | `string`  | —              | Database connection string |
| `dialect`          | `Dialect` | `"postgresql"` | Database dialect           |

Returns `MigrationStatus`:

```typescript
interface MigrationStatus {
  applied: string[];
  pending: string[];
  lastApplied: string | null;
}
```

### `Dialect`

```typescript
type Dialect = "postgresql" | "postgres" | "mysql";
```

`"postgresql"` and `"postgres"` are equivalent aliases.

## What It Creates

Each migration run creates and manages:

- `outbox_events` — Transactional outbox event table
- `inbox_events` — Idempotent inbox event table
- Associated indexes for polling and deduplication
- `__outboxy_migrations` — Internal tracking table

## License

MIT