# mparticle

> Node SDK for the mParticle HTTP API

Latest version **1.0.8** (published 2021-11-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mparticle
pnpm add mparticle
yarn add mparticle
bun add mparticle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-11-17 |
| First published | 2017-01-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 296.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mparticle-teamcity, samdozor, rmi22186, peterjenkins, danhendrix, tbreffni, alexs-mparticle, willpassidomo, bstalnaker, mparticle-ci |

## Links

- npm: https://www.npmjs.com/package/mparticle
- npm.io page: https://npm.io/package/mparticle

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) ^3.8.3

## Recent versions

- 1.0.8 (latest) — 2021-11-17
- 1.0.7 — 2021-05-05
- 1.0.6 — 2020-02-18
- 1.0.5 — 2020-01-13
- 1.0.4 — 2019-10-16
- 1.0.3 — 2019-03-18
- 1.0.2 — 2017-03-06
- 1.0.1 — 2017-01-13

## README

<img src="http://static.mparticle.com/sdk/logo.svg" width="280">

## mParticle Node SDK

This is the mParticle Node SDK - use it to send your data to the [mParticle platform](https://www.mparticle.com/) and off to 100+ data services.

### Requirements

Node JS 4.2.2 or later.

### Installation

```sh
npm install mparticle
```

## Usage

```javascript
var mParticle = require('mparticle');

var api = new mParticle.EventsApi(new mParticle.Configuration(
    'REPLACE WITH API KEY', 
    'REPLACE WITH API SECRET'));

var batch = new mParticle.Batch(mParticle.Batch.Environment.development);

batch.user_identities = new mParticle.UserIdentities();
batch.user_identities.customerid = '123456' // identify the user (required)

batch.user_attributes = {'hair color': 'brown'}

var event = new mParticle.AppEvent(mParticle.AppEvent.CustomEventType.navigation, 
  'Hello World');

batch.addEvent(event);

var body = [batch]; // {[Batch]} Up to 100 Batch objects

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};

api.bulkUploadEvents(body, callback);

// or upload a single batch
//api.uploadEvents(body, batch) 

```

### License

[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)

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