versolearning / meteor-intercom

Reactive intercom integration for Meteor
47 stars 15 forks source link

Cannot call method 'create' of undefined #31

Closed davelovemartin closed 7 years ago

davelovemartin commented 8 years ago

IntercomClient is undefined. Is this relating to #25 ?

My intercom Messenger is up and running OK

shelkie commented 8 years ago

Have you added your Intercom account info to Meteor.settings?

Meteor.settings.public.intercom Meteor.settings.public.intercom.id Meteor.settings.intercom.apikey (not public)

davelovemartin commented 8 years ago

Yes all settings present and correct - my Messenger is working correctly.

dburles commented 8 years ago

It seems like it wasn't exporting the instance correctly, this is now fixed with 1.4.0 though with a slightly different usage:

const client = IntercomClient();

// Create an event for a user
client.events.create({
  event_name: 'Test event',
  created_at: Math.floor(new Date().getTime() / 1000),
  user_id: '<Insert meteor user id>'
}, function (d) {
  console.log(d);
});