How to use the amplitude-js/amplitude.js.getInstance function in amplitude-js

To help you get started, we’ve selected a few amplitude-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gameclosure / devkit-core / src / clientapi / analytics / index.js View on Github external
_initAmplitude(key) {
    this._amplitudeClient = amplitude.getInstance();
    this._amplitudeClient.init(key);
    if (!this.userID) {
      throw new Error('userID is falsey');
    }
    this._amplitudeClient.setUserId(this.userID);
  }

amplitude-js

Javascript library for Amplitude Analytics

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis