Giter VIP home page Giter VIP logo

meteor-intercom's People

Contributors

alxbck avatar dandv avatar dburles avatar hanchang avatar julie-is-late avatar npvn avatar shelkie avatar timbotnik avatar tmeasday avatar zol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-intercom's Issues

Have an option not to use the widget

It would be nice to have an option not to use the widget, especially considering that if your on the free plan which does not have the messaging option

Not sending custom data

It seems that the package does not support custom data, here is my code

Also the name is not sending

// Intercom

IntercomSettings.userInfo = function(user, info) {
   // add properties to the info object, for instance:
   info.email = profile.email;
   info['name'] = profile.name;
   info.created_at = profile.createdAt;
   info.user_type = type;
   info.user_created_at = profile.createdAt;
   info.last_activity_in_a_loop_at = lastActivityInALoopTimestamp;
   info.program_invited_at = programInvitedAtTimestamp;
   info.program_name = program[0].name;
   info.program_self_service_modal = selfServiceModal;
   info.program_created_at = programCreatedAtTimestamp;
   info.mentee = mentee;
   info.mentor= mentor;
 };
});

TypeError: Cannot read property 'events' of undefined

Hey there,

I'm having a problem with the server side events:

TypeError: Cannot read property 'events' of undefined

I've added all the intercom settings: intercom.secret, public.intercom.id and public.intercom.apikey

and I'm using the example provided in a server method:

IntercomClient.events.create({ event_name: 'Test event', created_at: Math.floor(new Date().getTime()/1000), user_id: Meteor.userId() }, function (d) { console.log(d); });

is there a step I am missing?

Apart from this it is working great

Thanks,
Dave

App Id not send after logout

We're noticing some issues when users logout (Meteor.logout). On logout, the following Intercom endpoint is called:

POST
https://api-iam.intercom.io/widget_api/conversations

With payload:

page=1&per_page=10&referer=http%3A%2F%2Fexample.com.com%2Flogin&user_data=%7B%7D&Idempotency-Key=4eb0420d

The user_data is empty, which I'm not sure is correct (I believe Intercom has a specific logout endpoint for users), but the app_id clearly isn't set. The response coming back from Intercom is a 404:

{"type":"error.list","request_id":"56d538f2-872a-4521-b31f-ac4ea1f70daf","errors":"code":"not_found","message":"App Not Found "}]}

From this point on no Intercom functionality will work anymore until a hard page reload is performed.

Any ideas/assistance appreciated.

Race condition when calling intercom and using secure mode

I found out that in some cases when using secure mode with this package there's a race condition that causes Intercom's load failure.

Repro:

  1. Create a meteor app and add mateor-intercom. Add the app id and secret key to the settings file
  2. Deploy your app to remote servers (this never happened to me on localhost, only remote servers - aka a race condition)
  3. Login to your app => Intercom works as expected
  4. Reload the page (do not log out) => Intercom fails with 403 to the /ping HTTP POST request

If you look at the network inspector you see that the call to /ping lacks user_data.user_hash which is required for secure communication.
Again, as noted, this is a race condition, sometimes happens (happens to me a lot) but sometimes it doesn't. It happens only after logging in and then refreshing the page (while the user is still logged in). The problem is that the user.intercomHash value doesn't exist yet on the user object.

Workaround:
I found a workaround using the function IntercomSettings.userInfo:

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

While implementing this workaround is fine by me, I think most users would appreciate a proper fix at the package level, just before invoking the function IntercomSettings.userInfo

HTH

Hide Intercom messenger for certain roles.

We only want a certain set of users within the app to be intercom customers (and hide the widget to others). Essentially, admins are allowed to use Intercom and count as intercom users, regular users don't.

I've tried disabling the messenger in Intercom and using the following in the layout.onRendered, but the widget still shows. Any ideas?

var userId = Meteor.userId();
var intercomUser = Roles.userIsInRole(userId, ['orgAdmin']);

  if (intercomUser) {
    IntercomSettings.widget = {
      activator: "#IntercomDefaultWidget"
    };
    console.log("Intercom user");
  } else {
    console.log("Not Intercom user");
  }

'addMetric' of undefined

i keep getting this error, but it worked once. i'm not sure what's up here or why this.client is undefined.

Uncaught TypeError: Cannot read property 'addMetric' of undefined

all the fields in my info object are being set by this func:

IntercomSettings.userInfo = function( user, info ){
  if( !user || !user.services ){
    return false
  }
  info.email = user.profile.email
  info.name = user.profile.name
  info.created_at = user.createdAt
}

the user.services check is for my extended data publication which includes the createdAt field. all the fields in my info object are being set.

any help?

Issue with browsers that don't reliably fire window.onload

This seems to be an issue on some mobile browsers (such as mobile Safari) but possibly others that don't reliably fire window.onload. In this case, the widget script is never properly injected and Intercom events do not get recorded.

Intercom Cordova Plugin

Would be great to add documentation for how to integrate with Intercom's Cordova plugin.
Thanks!

what is it? what does it do?

Hi Tom,

can you maybe put a few lines in the README what this package is/does? Is it some sort of voice communication?

Getting error when window is refreshed, intended or bug?

Also happens on HCR.

POST https://api.intercom.io/vjs/users/ping 403 (Forbidden) intercom-widget.v1.js:1
Intercom.Util.ajax_call intercom-widget.v1.js:1
n.ping_server intercom-widget.v1.js:1
n.init intercom-widget.v1.js:1
Intercom.init_inbox intercom-widget.v1.js:8
e.boot intercom-widget.v1.js:2
window.intercom_obj.object.window.intercom_obj.ready.window.intercom_obj.object.window.intercom_obj.object.window.Intercom.c intercom-widget.v1.js:8
i intercom_loader.js:1
(anonymous function) intercom_client.js:47
callWithNoYieldsAllowed deps.js:53
_assign._compute deps.js:191
_assign._recompute deps.js:205
_assign.flush deps.js:303
["You have enabled secure mode in your app and Intercom cannot authenticate this user."]

Intercom client features

Thanks for the awesome package.
after your loader function executed, we can use Intercom() function.
we need to use it to add an event from the client side like Intercom('trackEvent', 'custom-event').
and also Intercom('update') to interact with the users.
Do you have a plan to support those method in your package? or do we need to keep using Intercom directly.
I think it will be better if README.md have a mention for those methods.

https://docs.intercom.io/install-on-your-product-or-site/other-ways-to-get-started/integrate-intercom-in-a-single-page-app

Update intercom-client

The NPM package is used with version 1.0.1, while 2.6.0 is the current one. There might be compatibility issues.

Having an issue with the settings setup

Hi,
I'm hoping you can help me I'm having an issue setting up the settings json file maybe I'm doing it wrong I keep getting the following error message - Exception from Deps recompute function: TypeError: Cannot read property 'public' of undefined

I have a settings.json file in the root of my app

{
"intercomSettings": [
{
"public.intercom.id": "aasdsd"
}
]
}

also tried it this way

{
"intercomSettings":
{
"public":
{
"intercom.id": "lasdsj"
}
}

}

Secure mode error

I'm running into the same issue as #3

But I am waiting for the user hash to be ready

I'm running into the same issue only happens on page refresh I'm making sure I have the users intercom hash but still getting this error here is my code any ideas

//Intercom sending data
IntercomSettings.userInfo = function(user, info) {
// add properties to the info object, for instance:
if (user.intercomHash)
info.email = user.email;
info.name = user.profile.name;
};

How to specify app id?

Hi!
I am trying to specify Meteor.settings.public.intercom.id
but i get: TypeError: Cannot read property 'intercom' of undefined

could you please paste how to specify intercom.id?

Thanks a lot!

Getting error on intercom client

frame.742432e1.js:16 Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'Integrations' in undefined
at n (frame.742432e1.js:16)
at i (frame.742432e1.js:9)
at Object.o [as post] (frame.742432e1.js:9)
at Object.x [as createEvent] (frame.742432e1.js:1)
at frame.742432e1.js:5
at Object.dispatch (frame.742432e1.js:29)
at frame.742432e1.js:17
at e.value (frame.742432e1.js:17)
at e.value (frame.742432e1.js:17)
at

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.