ember-cli-intercom
v0.4.0
Published
Ember addon to easily add Intercom to your app.
Downloads
44
Readme
ember-cli-intercom
Easily add Intercom to your app.
Installation
# From within your ember-cli project
ember install ember-cli-intercom
Usage
First you'll need to configure your Intercom App ID:
// config/environment.js
ENV['ember-cli-intercom'] = {
appId: '[YOUR_APP_ID]'
};
Then, once a user has authenticated, you will need to boot intercom. You can inject the intercom
service provided by this addon into a route/component/service/whatever
and call the boot method:
this.get('intercom').boot({
name: '[YOUR_USERS_NAME]',
email: '[YOUR_USERS_EMAIL]',
created_at: '[YOUR_USERS_SIGNUP_DATE]'
});
API
This service exposes some of the Intercom available API.
Intercom('boot')
this.get('intercom').boot({});
Intercom('shutdown')
this.get('intercom').shutdown();
Intercom('hide')
this.get('intercom').hide();
Intercom('show')
this.get('intercom').show();
Intercom('showMessages')
this.get('intercom').showMessages();
Intercom('showNewMessage', 'pre-populated content')
You can use this either with or without the text parameter.
this.get('intercom').showNewMessage('My text'); this.get('intercom').showNewMessage();
Intercom('trackEvent')
this.get('intercom').trackEvent('event-name', { meta: data });