Intercom messenger for Ember with support for custom attributes.
Install with ember install ember-cli-intercom-messenger
.
You must provide your Intercom app ID in your app's config/environment.js
file.
module.exports = function(environment) {
var ENV = {
'intercom-messenger': {
appId: null,
enabled: false // Optional: Disable the addon on a per environment basis.
},
};
return ENV;
}
In your app/controllers/application.js
:
import Controller from 'ember-controller';
import computed from 'ember-computed';
export default Controller.extend({
user: null,
intercomSettings: computed(function() {
return {
user_id: this.get('user.id'),
user_hash: this.get('user.hash')
};
})
});
In your app/templates/application.hbs
:
Note that {{intercom-messenger}}
allows you to define any custom attributes within intercomSettings
.
Just remember to adhere to Intercom's guideline on sending custom attributes.
git clone <repository-url>
this repositorycd ember-cli-intercom-messenger
npm install
ember serve
- Visit your app at http://localhost:4200.
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.