v1.4.2Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor Intercom

This is a fork of the perculate:intercom package, where the e-mailaddress of the user is used to identify the user in intercom. This is useful when multiple apps are sending data to the same intercom application, as each user has a unique Meteor userId, but if they log in with oauth, you also know their verified e-mailaddress.


Intercom can be installed with Meteor's package manager:

$ meteor add q42:intercom-oauthid


Ensure you have Meteor.settings.intercom.secret and Meteor.settings.public.intercom.id defined to the values provided to you by Intercom. Also define Meteor.settings.public.intercom.apikey if you intend to use Intercom on the server side.

Some Intercom subscription packages allow for anonymous users. To enable the use of anonymous users, set Meteor.settings.public.intercom.allowAnonymous to true.

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  }

email and name are preset fields provided by Intercom. You may add any additional custom user attribute.

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.

1IntercomSettings.userInfo = function (user, info) {
2  if (!user.intercomHash) {
3    return false; // the hash isn't loaded to the users collection yet. come back later.
4  }
5  // ...

If you want to add fields sent to intercom for an anonymous user, you can add them through in the anonymousInfo function.

1IntercomSettings.anonymousInfo = function ( info ) {
2  // check all router subscriptions have loaded
3  if (!Router.current() || !Router.current().ready())
4    return false;
6  info.anonymous = true;
7  return;

On the server, you can also interact with the Intercom API via the official intercom-node client.

1// Create an event for a user
3  event_name: 'Test event',
4  created_at: Math.floor(new Date().getTime()/1000),
5  user_id: '<Insert user e-mail address>'
6}, function (d) {
7  console.log(d);


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.