versolearning / meteor-intercom Goto Github PK
View Code? Open in Web Editor NEWReactive intercom integration for Meteor
Reactive intercom integration for Meteor
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
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;
};
});
Take a look at this variable: it doesn't seems to be defined anywhere.
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
How do I do it with this package?
It might be interesting to add this in the readme:
https://meteoruniversity.org/integrating-intercom-io-into-a-meteor-app/
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.
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:
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
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");
}
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?
How can I change the intercom authentication to OAuth using this package? As the API keys are getting deprecated soon.
Please check this.
The link to "integrating-intercom-io-into-a-meteor-app" is broken!
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.
Would be great to add documentation for how to integrate with Intercom's Cordova plugin.
Thanks!
Hi Tom,
can you maybe put a few lines in the README what this package is/does? Is it some sort of voice communication?
Deps, a deprecated command is being used. Could you please update it to Tracker.autorun()?
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."]
On app startup, we sometimes (not always) get:
POST https://api-ping.intercom.io/vjs/users/ping 403 (Forbidden)
and Intercom does not initialize. Haven't checked all conditions, but this is on localhost.
Thanks.
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.
The NPM package is used with version 1.0.1
, while 2.6.0
is the current one. There might be compatibility issues.
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"
}
}
}
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;
};
IntercomClient is undefined. Is this relating to #25 ?
My intercom Messenger is up and running OK
Since intercom will deprecate on api keys on january 2017, it would be nice to have support of the personal access tokens.
I'm passing in some new custom properties and the key shows up in Intercom but but the values don't update until that user comes back to the app. Is there a way to update those values regardless of the user being logged in?
I'm sure the answer is here: http://docs.intercom.io/install-on-your-web-product/intercom-javascript-api, I'm just not sure how to incorporate this with the package. thanks for the help!
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!
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.