# How to use mParticle Web SDK with the Vega SDK

**URL:** <https://community.amazondeveloper.com/t/how-to-use-mparticle-web-sdk-with-the-vega-sdk/2843>\
**Category:** Knowledge Base\
**Created:** [February 15, 2024, 4:52pm UTC](https://community.amazondeveloper.com/t/how-to-use-mparticle-web-sdk-with-the-vega-sdk/2843 "2024-02-15T16:52:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Sapountzis](https://dhm3gbtzu79o6.cloudfront.net/user_avatar/community.amazondeveloper.com/alexander_sapountzis/32/444_2.png) [@Alexander\_Sapountzis](https://community.amazondeveloper.com/u/Alexander_Sapountzis)\
**Post date:** [February 15, 2024, 4:52pm UTC](https://community.amazondeveloper.com/t/how-to-use-mparticle-web-sdk-with-the-vega-sdk/2843/1 "2024-02-15T16:52:03Z")

</div>

## Overview

This document outlines using the mParticle Web SDK with the Vega SDK.

We recently completed our MVP so that developers can start implementing mParticle in their Vega apps. We will continue to iterate, but we want to release this so that our partners can start implementing and testing their apps.

Currently, the MVP disables access to Persistence (such as local storage & cookies) and some other DOM related properties. In future versions, we will add support for Vega’s persistence layer and other Vega-specific versions of these disabled properties.

Should you encounter any issues or have specific requests, questions or feedback, please use the contact information at the end of this document. Please also understand that we are actively developing this SDK and will keep you informed of changes as we make them available.

## Installation

Self Hosting mParticle: [https://docs.mparticle.com/developers/sdk/web/self-hosting/](https://docs.mparticle.com/developers/sdk/web/self-hosting/)

Our Vega SDK will only work via self-hosting ([see docs more details about self-hosting](https://docs.mparticle.com/developers/sdk/web/self-hosting/)). As the SDK is under active development, there are a few modifications to the steps in the doc.

### NPM Configuration

For step 1, instead of installing the Web SDK from our NPM repository, use our GitHub repository’s mp-koala branch instead:

Instead of:

`npm i @mparticle/web-sdk`

Do this:

`npm i https://github.com/mParticle/mparticle-web-sdk.git#mp-koala.0.1.0 --save`

Note that only the core SDK is currently supported. Since many partners are still updating their apps to work on Vega’s platform, data will only be sent to mParticle, and not forwarded to partners yet. Attempting to add kits will result in errors or unexpected behavior and is not currently supported.

### SDK Configuration

For Step 3, add the following to the mParticle Config object: usePersistence: false

```auto
var mParticleConfig = {
    usePersistence: false, // <-- new setting
    isDevelopmentMode: true,
    identifyRequest: {
        userIdentities: {
            email: '[h.jekyll.md@example.com](mailto:h.jekyll.md@example.com)',
            customerid: 'h.jekyll.md'
        }
    },
};

```

Apart from these two changes, the installation should be the same.

### Example Configuration

Here is a full example of what your initialization should look like:

```auto
// your main index.js file
import mParticle from '@mparticle/web-sdk';

var mParticleConfig = {
    usePersistence: false, // <-- new setting
    isDevelopmentMode: true,
    identifyRequest: {
        userIdentities: {
            email: '[h.jekyll.md@example.com](mailto:h.jekyll.md@example.com)',
            customerid: 'h.jekyll.md'
        }
    },
    identityCallback: function(result) {
        // Do something once an identity call has been made.
        // For more information, see https://docs.mparticle.com/developers/sdk/web/idsync/#sdk-initialization-and-identify
        console.log(result);
    },
};

\mParticle.init('apiKey', mParticleConfig)

```

As our development of Vega continues, we will follow up with updated docs. Once this is ready, we will also provide specific installation instructions for any additional packages and configuration changes unique to Vega.

## Known Limitations

As this is an MVP, the SDK has several limitations, including the current lack of persistence support. We plan to resolve known limitations with each subsequent release.

NOTE: This version of the Web SDK has only been tested with version 0.5 of the Vega SDK.

- As stated above, only the core SDK will currently work. You will only see events in your Live Stream and not any downstream client side partners yet. Adding kits will not currently work and may result in app crashes.

- Local Storage and Cookies are not supported by Vega. In a future version, we will introduce Vega’s persistence with instructions on how to use it. Since the persistence layer will come in a future update, some information will be lost upon app refresh (the list is not exhaustive):

- Device and Session IDs

- Consent State is not currently included within uploads

- Updating User Identities and Attributes

- Screen Size in Device Info

- PageViews

- Events uploaded upon app closing/hiding

- The Web SDK listens for events bound to the DOM or Window to determine if the browser has been minified or closed. These are unique to a web browser which Vega does not support

- As long as the app is running on a device, it should continue to send events

As we continue developing new features, we will provide new updates to set expectations and deliverables.

Upcoming Milestones

1. Vega Persistence - This should resolve most of the known issues above
2. Support of React-Native specific features

## Support

For any support inquiries, feature requests or reporting of bugs, please reply to this thread or message me directly

-Alex Sapountzis  
Software Engineer @ mParticle
