Intercom
Configuring the Intercom integration allows you to display your user’s session data (location, browser type, …) and conversations.
In order for your intercom integration to work properly, you will have to use the version 2 of intercom API. To do so, you'll need go to the intercom developer hub and ensure that the app registered to retrieve your API key uses the intercom API version 2.0.
First, add the intercom client as a dependency to your project:
SQL
Mongodb
Rails
1
npm install [email protected]
Copied!
1
npm install [email protected]
Copied!
Gemfile
1
gem 'intercom'
Copied!
Then, you need to add the intercom integration:
SQL
Mongodb
Untitled
middlewares/forestadmin.js
1
...
2
const intercomClient = require('intercom-client');
3
const { objectMapping, connections } = require('../models');
4
5
module.exports = async function (app) {
6
app.use(await Liana.init({
7
configDir: path.join(__dirname, '../forest'),
8
envSecret: process.env.FOREST_ENV_SECRET,
9
authSecret: process.env.FOREST_AUTH_SECRET,
10
objectMapping,
11
connections,
12
integrations: {
13
intercom: {
14
accessToken: process.env.INTERCOM_ACCESS_TOKEN,
15
intercom: intercomClient,
16
mapping: ['users.email'],
17
},
18
},
19
}));
20
21
console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
22
};
Copied!
middlewares/forestadmin.js
1
...
2
const intercomClient = require('intercom-client');
3
const { objectMapping, connections } = require('../models');
4
5
module.exports = async function (app) {
6
app.use(await Liana.init({
7
configDir: path.join(__dirname, '../forest'),
8
envSecret: process.env.FOREST_ENV_SECRET,
9
authSecret: process.env.FOREST_AUTH_SECRET,
10
objectMapping,
11
connections,
12
integrations: {
13
intercom: {
14
accessToken: process.env.INTERCOM_ACCESS_TOKEN,
15
intercom: intercomClient,
16
mapping: ['users.email'],
17
},
18
},
19
}));
20
21
console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
22
};
Copied!
/config/initializers/forest_liana.rb
1
ForestLiana.integrations = {
2
# ...
3
intercom: {
4
access_token: ENV['INTERCOM_ACCESS_TOKEN'],
5
mapping: ['Customer']
6
}
7
}
Copied!
  • intercom is used to pass the intercom client version. To do so, you have to require the previously installed client, as in the example.
  • accessToken should be defined in your environment variable and is provided by intercom.
  • mapping refers to the collection and field name you want to map to intercom data. It can either be a field that contain emails that refer to intercom users or a field that contain ids mapping the external_id in Intercom API.
You will have to restart your server to see Intercom plugged to your project.

Others

Copy link
Contents
Others