open-index/open-npm huggingface dataset:
npm package: @squasher-ai/agent
Description: Official @squasher-ai/agent package for Squasher.
Latest version: 0.1.1

# @squasher-ai/agent

Agent telemetry SDK for Squasher.

Capture AI agent sessions, spans, tool calls, and LLM generations from a server-side agent runtime.

## Install

```bash
npm install @squasher-ai/agent
```

## Setup

```ts
import { init } from "@squasher-ai/agent";

init({
  apiKey: process.env.SQUASHER_API_KEY!,
  projectId: process.env.SQUASHER_PROJECT_ID!,
  agentId: "support-bot",
  workflowId: "triage-and-reply",
});
```

## Capture Agent Events

```ts
import {
  captureGeneration,
  captureSessionEnd,
  captureSessionStart,
  captureToolCall,
  flush,
} from "@squasher-ai/agent";

await captureSessionStart({ sessionId: "sess_123", runId: "run_123" });
await captureToolCall("db.lookup", {
  sessionId: "sess_123",
  traceId: "trace_123",
  status: "ok",
  input: { id: "err_123" },
  output: { rows: 1 },
});
await captureGeneration("Drafted customer reply", {
  sessionId: "sess_123",
  traceId: "trace_123",
  provider: "openrouter",
  model: "openai/gpt-4o-mini",
});
await captureSessionEnd({ sessionId: "sess_123", status: "completed" });
await flush();
```

Docs: https://docs.squasher.ai
Homepage: https://squasher.ai
npm package: @squasher-ai/browser
Description: Official @squasher-ai/browser package for Squasher.
Latest version: 0.1.1

# @squasher-ai/browser

Browser SDK for Squasher.

Capture frontend errors, Core Web Vitals, automatic breadcrumbs, analytics-style events, and optional session replay from a browser app.

## Install

```bash
npm install @squasher-ai/browser
```

## Setup

```ts
import { init } from "@squasher-ai/browser";

init({
  apiKey: process.env.NEXT_PUBLIC_SQUASHER_API_KEY!,
  projectId: process.env.NEXT_PUBLIC_SQUASHER_PROJECT_ID!,
  environment: process.env.NODE_ENV,
  replay: {
    enabled: true,
    sampleRate: 0.1,
  },
});
```

## React Error Boundary

```tsx
import { SquasherErrorBoundary } from "@squasher-ai/browser/react";

<SquasherErrorBoundary fallback={<div>Something went wrong.</div>}>
  <App />
</SquasherErrorBoundary>;
```

## Manual Capture

```ts
import { captureError, captureMessage, page, track } from "@squasher-ai/browser";

track("checkout_started", { step: 1 });
page("Checkout");
captureMessage("Frontend boot complete", "info");
captureError(new Error("Checkout failed"), { cartId: "cart_123" });
```

Docs: https://docs.squasher.ai
Homepage: https://squasher.ai
npm package: @squasher-ai/nextjs
Description: Official @squasher-ai/nextjs package for Squasher.
Latest version: 0.1.1

# @squasher-ai/nextjs

Official @squasher-ai/nextjs package for Squasher.

## Install

```bash
npm install @squasher-ai/nextjs
```

Docs: https://docs.squasher.ai
Homepage: https://squasher.ai
npm package: @squasher-ai/node
Description: Official @squasher-ai/node package for Squasher.
Latest version: 0.1.1

# @squasher-ai/node

Official @squasher-ai/node package for Squasher.

## Install

```bash
npm install @squasher-ai/node
```

Docs: https://docs.squasher.ai
Homepage: https://squasher.ai
npm package: @squasher-ai/winston
Description: Squasher transport for Winston logger
Latest version: 0.1.1

# `@squasher-ai/winston`

Winston transport for sending logs to Squasher.

## Install

```bash
npm install @squasher-ai/winston winston
```

## Usage

```ts
import winston from "winston";
import { SquasherTransport } from "@squasher-ai/winston";

const squasherTransport = new SquasherTransport({
  apiKey: process.env.SQUASHER_API_KEY ?? "",
  projectId: process.env.SQUASHER_PROJECT_ID ?? "",
  endpoint: "https://ingest.squasher.ai",
  level: "error",
});

const logger = winston.createLogger({
  format: winston.format.combine(winston.format.timestamp(), winston.format.metadata()),
  transports: [new winston.transports.Console(), squasherTransport],
});

logger.error("Database connection failed", {
  requestId: "req-123",
  host: "db-primary",
});

await squasherTransport.close();
```

## Notes

- Sends events to `POST /v1/ingest/{projectId}` with the `x-squasher-key` header.
- Payload shape: `message`, `level`, `timestamp`, `tags.transport = "winston"`, and `extra`.
- If `info.metadata` exists it is used for `extra`; otherwise extra Winston fields are forwarded.
- Queued events are batched and flushed automatically on `beforeExit`, or manually with `close()`.