open-index/open-npm huggingface dataset:
npm package: @metrone-io/mcp
Description: Metrone MCP server — expose analytics to AI agents via Model Context Protocol
Author: Metrone
Latest version: 1.0.1

# @metrone-io/mcp

[Model Context Protocol](https://modelcontextprotocol.io) server for [Metrone](https://metrone.io) analytics. Gives AI agents (Claude, GPT, Cursor, etc.) native access to your analytics data.

## Install

```bash
npm install -g @metrone-io/mcp
```

## Setup

Add to your MCP client configuration:

```json
{
  "mcpServers": {
    "metrone": {
      "command": "npx",
      "args": ["-y", "@metrone-io/mcp"],
      "env": {
        "METRONE_API_KEY": "metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "METRONE_PROJECT_ID": "proj_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}
```

## Available Tools

| Tool | Description |
|------|-------------|
| `metrone_get_stats` | Aggregate analytics (pageviews, visitors, bounce rate) |
| `metrone_get_events` | Recent events with filtering |
| `metrone_get_pages` | Top pages by views |
| `metrone_get_sources` | Traffic sources breakdown |
| `metrone_get_live` | Current live visitors |
| `metrone_track_event` | Track a custom event |
| `metrone_track_ai_call` | Track an AI call or chat session |

## Example

Ask your AI agent:

> "How many pageviews did we get this week?"
> "What are our top traffic sources?"
> "Track a conversion event for user signup"

## Documentation

[metrone.io/docs](https://metrone.io/docs)

## License

[MIT](../../LICENSE)
npm package: @metrone-io/react
Description: Metrone React integration - Privacy-first analytics for React
Author: Metrone
Latest version: 1.2.0

# @metrone-io/react

React bindings for [Metrone](https://metrone.io) analytics.

Provider component, hooks, and HOC for integrating Metrone into React and Next.js applications.

## Install

```bash
npm install @metrone-io/react @metrone-io/sdk
```

## Usage

```jsx
import { MetroneProvider, useMetrone } from '@metrone-io/react'

function App() {
  return (
    <MetroneProvider
      config={{
        apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        endpoint: '/api/analytics/events'
      }}
    >
      <MyApp />
    </MetroneProvider>
  )
}

function MyComponent() {
  const { trackEvent, trackConversion, trackAICall } = useMetrone()
  return (
    <button onClick={() => trackEvent('button_click', { button_id: 'cta' })}>
      Click Me
    </button>
  )
}
```

## API

- **`MetroneProvider`** — Context provider, initializes the SDK
- **`useMetrone()`** — Hook returning all tracking methods
- **`withMetrone(Component)`** — HOC injecting Metrone props
- **Automatic route tracking** — SPA pageviews handled by the SDK (`autoTrackSPA: true`)
- **Automatic click tracking** — Outbound links, tel:, mailto:, downloads, and `data-track` elements

### Available tracking methods from `useMetrone()`

| Method | Description |
|--------|-------------|
| `trackEvent(name, data?)` | Track a custom event |
| `trackConversion(type, value?, data?)` | Track a conversion |
| `trackPageView(url?, title?)` | Manually track a pageview |
| `trackAICall(data)` | Track an AI voice call |
| `trackAIChat(data)` | Track an AI chat session |
| `trackAIIntent(data)` | Track AI intent detection |
| `trackAISession(data)` | Track AI session lifecycle |
| `flush()` | Flush pending events |

## Documentation

[metrone.io/docs](https://metrone.io/docs)

## License

[MIT](../../LICENSE)
npm package: @metrone-io/sdk
Description: Metrone - Privacy-first analytics SDK with retry logic and AI tracking
Author: Metrone
Latest version: 1.4.1

# @metrone-io/sdk

Privacy-first browser analytics SDK for [Metrone](https://metrone.io).

Lightweight, cookie-free tracking with automatic pageviews, custom events, conversions, AI interaction tracking, batching, retries, and DNT/consent support.

## Install

```bash
npm install @metrone-io/sdk
```

## Usage

```javascript
import Metrone from '@metrone-io/sdk'

const analytics = new Metrone({
  apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  endpoint: '/api/analytics/events'
})

analytics.pageview()
analytics.track('button_click', { button_id: 'cta' })
analytics.conversion('purchase', 49.99)
```

### Script tag

```html
<script src="https://your-domain.com/js/metrone.js"></script>
<script>
  Metrone.init({
    apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    endpoint: '/api/analytics/events'
  })
</script>
```

### AI Tracking

```javascript
analytics.trackAICall({ call_id: 'call_123', provider: 'vapi', duration: 45 })
analytics.trackAIChat({ session_id: 'sess_456', provider: 'intercom', message_count: 8 })
analytics.trackAIIntent({ intent: 'book_appointment', confidence: 0.92, source: 'voice' })
analytics.trackAISession({ session_id: 'sess_456', action: 'end', duration: 120 })
```

### Zero-Code Click Tracking

```html
<button data-track="cta_hero">Get Started</button>
<a href="/pricing" data-track="nav_pricing">Pricing</a>
```

## Features

- Cookie-free, GDPR-compliant
- Automatic SPA route tracking
- Automatic outbound link, tel:, mailto:, and download click tracking
- Zero-code click tracking via `data-track` attribute
- AI voice call, chat, intent, and session tracking
- Event batching with sendBeacon flush on page unload
- Retry logic with exponential backoff
- Idempotency keys to prevent duplicate events
- DNT and consent mode support
- UMD + ESM builds

## Documentation

[metrone.io/docs](https://metrone.io/docs)

## License

[MIT](../../LICENSE)
npm package: @metrone-io/server
Description: Metrone server-side SDK for Node.js, Deno, Bun, and edge runtimes
Author: Metrone
Latest version: 1.0.1

# @metrone-io/server

Server-side SDK for [Metrone](https://metrone.io) analytics. Works with Node.js, Deno, Bun, and edge runtimes.

Track events, AI calls, and conversions from your backend. Read analytics data via the API.

## Install

```bash
npm install @metrone-io/server
```

## Usage

```javascript
import { MetroneServer } from '@metrone-io/server'

const metrone = new MetroneServer({
  apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
})

// Track events
await metrone.track('user_signup', { properties: { plan: 'pro' } })

// Track AI interactions
await metrone.trackAICall({
  call_id: 'call_123',
  provider: 'openai',
  duration: 120,
  intent: 'booking',
  outcome: 'converted'
})

// Read analytics
const stats = await metrone.getStats({ days: 7 })
const pages = await metrone.getPages({ days: 7, limit: 10 })
const live = await metrone.getLiveVisitors()
```

## Features

- Zero runtime dependencies
- Event tracking with batching and retries
- AI call and chat session tracking
- Read API for stats, pages, sources, events
- Live visitor count
- Works on Node.js 18+, Deno, Bun, Cloudflare Workers

## Documentation

[metrone.io/docs](https://metrone.io/docs)

## License

[MIT](../../LICENSE)