@mapbox/mapbox-events

1.0.0 • Public • Published

Build Status

Mapbox Events

Send events from the browser to the Mapbox events API.

Each call to push() is batched. Batches are flushed and sent to the server when the size of the batch reaches the flushAt threshold or when the time since the last event was pushed reaches the flushAfter threshold.

Example

var events = require('@mapbox/mapbox-events')({
    token: 'mapbox api token',
    flushAt: 20,
    flushAfter: 10000
});

events.push({
    event: 'foo',
    attribute1: 'foo',
    attribute2: 'bar'
});

Dependents (1)

Package Sidebar

Install

npm i @mapbox/mapbox-events

Weekly Downloads

114

Version

1.0.0

License

none

Unpacked Size

11.6 kB

Total Files

9

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user