Easily add Intercom to your app.
# From within your ember-cli project
ember install ember-cli-intercom
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]'
});
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 });