node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »


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.


var events = require('@mapbox/mapbox-events')({
    token: 'mapbox api token',
    flushAt: 20,
    flushAfter: 10000
    event: 'foo',
    attribute1: 'foo',
    attribute2: 'bar'