Intercom2db is a small utility that allow you to extract data from intercom to a database. Support only mysql for now.
$ npm install -g intercom2db
Intercom2db depends on Node.js and npm.
Create a config file like this :
// myconfig.js
module.exports = {
database: {
host: 'mysqlhost',
port: '3306',
user: 'username',
password: 'password',
database: 'intercom'
},
intercom: {
appId: 'your_intercom_app_id',
apiKey: 'your_intercom_api_key'
}
};
Launch the import
$ intercom2db path_to_my_config_file.js
Intercom2db ships with a docker container you can use to quickly get started and import your data:
docker pull rizeway/intercom2db
docker run --name intercom2db \
-e I2DB_DATABASE_HOST=your.mysql \
-e I2DB_DATABASE_USER=your_db_user \
-e I2DB_DATABASE_PASSWORD=your_db_user_password \
-e I2DB_API_APP_ID=your_intercom_app_id \
-e I2DB_API_KEY=your_intercom_api_key \
--rm rizeway/intercom2db
This will fire up a container and load your data in you.mysql
server. Here is the list of the available environment
variables:
Name | Default | Description |
---|---|---|
I2DB_DATABASE_HOST |
localhost |
MySQL host |
I2DB_DATABASE_PORT |
3306 |
MySQL port |
I2DB_DATABASE_USER |
root |
MySQL username |
I2DB_DATABASE_PASSWORD |
N/A | MySQL password |
I2DB_DATABASE_NAME |
intercom |
MySQL database name |
I2DB_API_APP_ID |
N/A | Intercom application ID |
I2DB_API_KEY |
N/A | Intercom API key |
If you don't want to use environment variables, you can still share a configuration file with your container thanks to docker volumes:
docker pull rizeway/intercom2db
docker run --name intercom2db \
-v /path/to/your/config.js:/app/config.js \
--rm rizeway/intercom2db /app/config.js
If you want to contribute to Intercom2db you can also use docker through docker-compose
:
export I2DB_API_APP_ID=your_intercom_app_id
export I2DB_API_KEY=your_intercom_api_key
docker-composer up
This will boot a mysql container and an Intercom2db container and link them together.