A small Meteor based web service that receives and relays events to Intercom.
- An Intercom application access token.
- This application is pre-configured to log errors to sentry.io. To log errors, you'll need a Sentry DSN (this is optional - if you don't specify a DSN remote error logging will be disabled).
- This application will only relay messages to Intercom if the originating request has a
write-token
set in its header, and if thatwrite-token
matches the environment configuredWRITE_TOKEN
.
> git clone https://github.com/hwillson/meteor-intercom-relay.git
> cd meteor-intercom-relay
> SENTRY_DSN="your dsn" INTERCOM_ACCESS_TOKEN="your token" WRITE_TOKEN="some random token" MONGO_URL=null meteor
Events can be sent into Intercom by POSTing event details to the /track-event
endpoint. For example, posting the following json
{
"email": "[email protected]",
"name": "Some event just happened"
}
to http://localhost:3000/track-event
results in the following event being sent into Intercom:
{
email: '[email protected]',
created_at: [time since epoch in seconds],
event_name: 'Some event just happened'
}