![Logo](https://cdn-clalk.nitrocdn.com/KqmKVeLhgFAzHWrUbBzmAbRgoFMrOqoq/assets/images/optimized/rev-0132753/wp-content/uploads/2022/06/moengage-logo-dark-2.svg)

# Moengage Web SDK

This is the npm package of the origin SDK. Please refer the documentation for full details [here](https://developers.moengage.com/hc/en-us/categories/360006308092-Web-SDK)

### Installation

Install the dependencies

```sh
$ npm i @moengage/web-sdk
```


### Example
```js
import moengage from '@moengage/web-sdk';

moengage.initialize(
  {
    appId: 'XXXXXXXXXXXX',
    env: 'LIVE',
    logLevel: 0,
  }
);

moengage.identifyUser({
  uid: 'abc@xyz.com',
  u_mb: '8989898989',
  u_fn: 'some name',
});

// or simply
moengage.identifyUser('abc@xyz.com') // sets just uid

moengage.setEmailId('qwerty@xyz.com');

moengage.trackEvent('Add to Cart', { name: 'Phone', price: '100000' });

moengage.logoutUser();

```



License
----

MIT







