Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions integrations/intercom/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.1.0 / 2022-09-06
==================
* Adding region support

3.0.0 / 2017-08-21
==================
Expand Down
4 changes: 4 additions & 0 deletions integrations/intercom/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var Intercom = (module.exports = integration('Intercom')
.option('activator', '#IntercomDefaultWidget')
.option('appId', '')
.option('richLinkProperties', [])
.option('apiBase', '')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Intercom isn't planning to make this required right? Wondering if we should default to the current value (US?) - what does the option look like in the app if you have 3 choices but none selected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually originally added the default (https://api-iam.intercom.io) here, but then thought that's not 100% backwards compatible, because it forces users to use https://api-iam.intercom.io, while the old behavior doesn't specify the API host explicitly. Although I'm not 100% sure if defaulting to https://api-iam.intercom.io would cause any issues, but if somehow some users override the API host, and then we override it again it will be bad.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, makes sense!

.tag('<script src="https://widget.intercom.io/widget/{{ appId }}">'));

/**
Expand Down Expand Up @@ -206,6 +207,9 @@ Intercom.prototype.bootOrUpdate = function(opts, integrationSettings) {
var method = this.booted === true ? 'update' : 'boot';
var activator = this.options.activator;
options.app_id = this.options.appId;
if (this.options.apiBase) {
options.api_base = this.options.apiBase;
}

// Intercom, will force the widget to appear if the selector is
// #IntercomDefaultWidget so no need to check inbox, just need to check that
Expand Down
2 changes: 1 addition & 1 deletion integrations/intercom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@segment/analytics.js-integration-intercom",
"description": "The Intercom analytics.js integration.",
"version": "3.0.2",
"version": "3.1.0",
"keywords": [
"analytics.js",
"analytics.js-integration",
Expand Down