Intercom

Intercom

Configuring the Intercom integration allows you to display your user’s session data (location, browser type, …) and conversations.

First, add the intercom client as a dependency to your project:

npm install [email protected]

Then, you need to add the intercom integration:

middlewares/forestadmin.js
...
const intercomClient = require('intercom-client');
const { objectMapping, connections } = require('../models');

module.exports = async function (app) {
  app.use(await Liana.init({
    configDir: path.join(__dirname, '../forest'),
    envSecret: process.env.FOREST_ENV_SECRET,
    authSecret: process.env.FOREST_AUTH_SECRET,
    objectMapping,
    connections,
    integrations: {
      intercom: {
        accessToken: process.env.INTERCOM_ACCESS_TOKEN,
        intercom: intercomClient,
        mapping: ['users.email'],
      },
    },
  }));

  console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
};
  • 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

Last updated

Was this helpful?