# bb-api-platforma

> API module for BetBooster Platform

Latest version **0.1.289** (published 2026-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install bb-api-platforma
pnpm add bb-api-platforma
yarn add bb-api-platforma
bun add bb-api-platforma
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.289 |
| Published | 2026-10-09 |
| First published | 2025-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tomy Bet |
| Maintainers | betbooster |
| Keywords | api, BetBooster, betting, typescript |

## Links

- npm: https://www.npmjs.com/package/bb-api-platforma
- Repository: https://gitlab.com/betseller/bb-api-platforma
- Homepage: https://betseller.gitlab.io/bb-api-platforma
- Issues: https://gitlab.com/betseller/bb-api-platforma/issues
- npm.io page: https://npm.io/package/bb-api-platforma

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.289 (latest) — 2026-10-09
- 0.1.288 — 2026-10-08
- 0.1.287 — 2026-09-26
- 0.1.286 — 2026-09-18
- 0.1.285 — 2026-09-14
- 0.1.284 — 2026-09-10
- 0.1.283 — 2026-09-09
- 0.1.282 — 2026-09-09
- 0.1.281 — 2026-09-08
- 0.1.280 — 2026-09-07
- 0.1.279 — 2026-09-02
- 0.1.278 — 2026-08-26
- 0.1.277 — 2026-08-23
- 0.1.276 — 2026-08-22
- 0.1.275 — 2026-08-20
- … 82 more at https://npm.io/package/bb-api-platforma/versions

## README

# BetBooster API Platform

Module package for working with API of BetBooster platform.

## Installation

To install the "bb-api-platforma" package, run the following command:

```bash
npm install bb-api-platforma
```

## Usage

```javascript

import axios from 'axios'
import { BetBoosterApi } from 'bb-api-platforma';

const axiosInstance = axios.create();
const apiRootUrl = 'https://api.example.com';
const defaultLanguage  = 'en';
const maxTimeout = 15000;
const isDevelopmentMode = !!process.env.DEV;
const api = new BetBoosterApi(axiosInstance, apiRootUrl, defaultLanguage, maxTimeout, isDevelopmentMode);

const res = await api2.login({ login: 'login', password: 'password' });

console.log(res);

// ...

```

## Presence tracker (Refferq)

`PresenceTracker` sends presence ticks, login/registration events, referral-link visits and code checks to Refferq. It lives next to `BetBoosterApi` and talks to it only through the duck-typed `ApiLike` interface (`isSinged`, `user`, `srvTag`); the API token is never sent. With an empty `siteKey` the tracker is disabled and all methods are silent.

```javascript
import { BetBoosterApi, PresenceTracker, detectEnvironment } from 'bb-api-platforma';

const tracker = new PresenceTracker({
  api,                                           // BetBoosterApi instance
  siteKey: 'pk_live_abc123',                     // Refferq site key; empty → disabled
  trackUrl: 'https://api.example.com/affiliate', // official API + /affiliate
  environment: detectEnvironment(),              // or { client, device, os } from Quasar Platform.is
  readUrlOnInit: true,                           // false for SPA with a router (call handleUrlCode yourself)
});

// login action
const res = await api.login({ login, password });
tracker.login(res.ok ? 'OK' : 'FAIL', res.ok ? undefined : res.errorCode);
if (res.ok) tracker.start();

// referral link ?ref=CODE (router)
router.beforeEach((to) => { if (typeof to.query.ref === 'string') tracker.handleUrlCode(to.query.ref); });

// code entered by the player
const check = await tracker.checkCode('PROMO10'); // { valid, kind, code, affiliateCode, ... }
const kind = await tracker.addCode('PROMO10');    // 'COUPON' | 'REFERRAL' | 'UNAVAILABLE' | null

// temporary registration → first login
const snapshot = await tracker.captureRegistrationSnapshot();
tracker.registration('OK', undefined, user.UserId, snapshot);
```

Options, methods and payloads are documented in the bundled `d.ts`. Tests: `npm run test:presence` (Node 22, `tsx --test`, no DOM).

## Documentation

The documentation for the `bb-api-platforma` API can be found at the following link: [https://betseller.gitlab.io/bb-api-platforma](https://betseller.gitlab.io/bb-api-platforma)

---
_Source: https://npm.io/package/bb-api-platforma · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
