open-index/open-npm huggingface dataset:
npm package: @metricsfirst/sdk
Description: MetricsFirst SDK for TypeScript/JavaScript - Analytics for Telegram bots
Author: MetricsFirst
Latest version: 0.1.3

# MetricsFirst TypeScript/JavaScript SDK

Official TypeScript/JavaScript SDK for [MetricsFirst](https://metricsfirst.com) - Analytics for Telegram bots.

> **Note:** Commands and interactions are tracked automatically when you add your bot to MetricsFirst. This SDK is for tracking custom events like services, purchases, and errors.

## Installation

```bash
npm install @metricsfirst/sdk
# or
pnpm add @metricsfirst/sdk
# or
yarn add @metricsfirst/sdk
```

## Features

- **Fire-and-forget**: All tracking calls are non-blocking and don't add latency
- **Automatic batching**: Events are queued and sent in batches
- **Error resilience**: Errors are logged, never thrown to your code
- **Memory safe**: Queue is limited to 1000 events to prevent memory issues

## Quick Start

```typescript
import { MetricsFirst } from '@metricsfirst/sdk';

const mf = new MetricsFirst({
  botId: 'your_bot_id',
  apiKey: 'your_api_key',
});

// Track a service (fire-and-forget, non-blocking)
mf.trackService({
  userId: 123456789,
  serviceName: 'image_generation',
  isFree: false,
  price: 10,
  currency: 'USD',
});

// Track a purchase
mf.trackPurchaseCompleted({
  userId: 123456789,
  purchaseId: 'purchase_123',
  price: 9.99,
  currency: 'USD',
  tariffName: 'Pro Plan',
});

// Shutdown when done (flushes remaining events)
await mf.shutdown();
```

## Available Methods

| Method                         | Description               |
| ------------------------------ | ------------------------- |
| `trackService()`               | Track services provided   |
| `trackError()`                 | Track errors              |
| `trackErrorFromException()`    | Track error from Error    |
| `trackPurchaseInitiated()`     | Track purchase start      |
| `trackPurchaseCompleted()`     | Track successful purchase |
| `trackPurchaseError()`         | Track failed purchase     |
| `trackRecurringChargeSuccess()`| Track subscription charge |
| `trackRecurringChargeFailed()` | Track failed charge       |
| `identify()`                   | Identify user             |
| `flush()`                      | Manually flush events     |
| `shutdown()`                   | Shutdown and flush        |

## Configuration

```typescript
const mf = new MetricsFirst({
  botId: 'your_bot_id',      // Required
  apiKey: 'your_api_key',    // Required
  apiUrl: 'https://api.metricsfirst.com',  // Custom API URL
  batchEvents: true,         // Batch events before sending
  batchSize: 10,             // Events per batch
  batchInterval: 5000,       // ms between flushes
  debug: false,              // Enable debug logging
  timeout: 10000,            // HTTP timeout in ms
});
```

## License

MIT
npm package: @metricsraptor/html5-player-react
Description: View the [docs](https://docs.metricsraptor.com/docs/installation/web/html5-react) for installation and usage instructions.
Author: Bas Wilson
Latest version: 0.0.2

# Metricsraptor React Hook

View the [docs](https://docs.metricsraptor.com/docs/installation/web/html5-react) for installation and usage instructions.
npm package: @metrik/meridiem
Description: Meridiem is a simple, lightweight and fast library written in TypeScript for parsing natural language time ranges (in the past) and converting them to a simple object. Powered by some simple RegEx patterns and the built-in `new Date()` parser. Inspired by
Author: Team Metrik
Latest version: 1.0.0

# `⏰ meridiem`

Meridiem is a simple, lightweight and fast library written in TypeScript for parsing natural language time ranges (in the past) and converting them to a simple object. Powered by some simple RegEx patterns and the built-in `new Date()` parser. Inspired by [chrono](
    https://github.com/wanasit/chrono
) and this [tweet](https://twitter.com/JohnPhamous/status/1630763699849015298) from @JohnPhamous about the new Vercel date range selector.

Has troubles with very large time ranges. Will work best if kept within 2-3 years of provided `currentDate` or the current date.

Compatible with Node, the browser, Deno and Bun. Only dependency is `date-fns`.

## Installation

```bash
# npm
npm install @metrik/meridiem
 
# yarn
yarn add @metrik/meridiem

# pnpm
pnpm add @metrik/meridiem
```

## Usage

```js
import { parse } from "@metrik/meridiem"

// You can pass a string to parse
const basicResult = parse("last week")

// {
//   start: 2023-03-10T00:00:00.000Z,
//   end: 2023-03-17T00:00:00.000Z
// }

// You can also pass a date to parse relative to
const relativeResult = parse("last week", new Date("January 1, 2023"))

// {
//   start: 2023-12-25T00:00:00.000Z,
//   end: 2023-01-01T00:00:00.000Z
// }

// If the date range is invalid, null is returned
const invalidResult = parse("invalid date range") // null
```