Meteor Intercom
A package to use Intercom.io easily with Meteor.
Installation
Intercom can be installed with Meteor's package manager:
$ meteor add percolate:intercom
API
Ensure you have Meteor.settings.intercom.secret
and Meteor.settings.public.intercom.id
defined to the values provided to you by Intercom.
By default, the package will send up the user's id, creation date, and hash (if defined, see below). To send custom data, set:
1IntercomSettings.userInfo = function(user, info) { 2 // add properties to the info object, for instance: 3 if (user.services.google) { 4 info.email = user.services.google.email; 5 info['Name'] = user.services.google.given_name + ' ' + user.services.google.family_name; 6 } 7}
If you need to wait on a user subscription for e.g. the hash to come down, you can return false
in your userInfo
function to tell the package to wait.
Notes
This package will automatically subscribe the current user to the currentUserIntercomHash
publication which will add an intercomHash
property to your user documents enabling the use of intercom's secure mode.
License
MIT. (c) Percolate Studio
Meteor Intercom was developed as part of the Verso project.