You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ember-userengage

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-userengage

The default blueprint for ember-cli addons.

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ember-userengage

Easily integrate userengage.io in your app as an Ember Service.

Install

Run the following command from inside your ember-cli project:

ember install ember-userengage

Configure

You need to set your userengage.io Api Key in the ENV var on your config/environment.js file, like this:

  var ENV = {
    // ...

    userEngage: {
      apiKey: 'your-userengage-api-key'
    }

    // ...
  }

Usage

A service named userengage will be available in your app, providing the following methods:

  • initialize(options)
  • refresh(options)
  • pageHit()
  • destroy()

They map to methods described in userengage.io official doc

Initialize Userengage widget for non-authenticated users

In your component or controller:

  userengage: Ember.inject.service(),
  actions: {
    initUserengageForGuests() {
      this.get('userengage').initialize();
    },
  }

Initialize Userengage widget for authenticated users

In your component or controller:

  userengage: Ember.inject.service(),
  actions: {
    initUserengageForGuests() {
      this.get('userengage').initialize({
        email: this.get('model.email'),
        name: this.get('model.fullName'),
        custom_attribute: this.get('model.customAttribute')
      });
    },
  }

Notifying visited pages to Userengage

In your app's router.js:

  didTransition() {
    this._super(...arguments);
    this.userengagePageChange();
  },

  userengage: Ember.inject.service(),
  userengagePageChange() {
    this.get('userengage').pageHit();
  }

Destroying Userengage widget

In your component or controller:

  userengage: Ember.inject.service(),
  actions: {
    destroy() {
      this.get('userengage').destroy();
    }
  }

License

ember-userengage is released under the MIT License.

Keywords

ember-addon

FAQs

Package last updated on 31 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts