No commit activity in last 3 years
No release in over 3 years
This is a wrapper for Intercom ruby gem(https://github.com/intercom/intercom-ruby) that offers a way for the developer to fire intercom events to different interom apps from a single application or service.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3

Runtime

~> 2.1
 Project Readme

DEPRECATED

The newest intercom ruby gem is awesome. No need for this hack anymore

Intercom-ruby wrapper

This is a simple wrapper to intercom that lets you create intercom events to multiple intercom apps from a single service. Unfortunately Intercom implementation of the ruby gem is a global singleton that demands app_id and app_api_key. This means that you cannot use multiple intercom apps from within your application reliably.

This gem overloads the ::Intercom::Event.create method, so you can pass app_id and app_api_key to it. This allows you to create intercom events to multiple intercom apps from a single service.

Installation

Add these to your gemfile:

gem 'intercom'
gem 'intercom_event_wrapper'

Require the gem somewhere

require 'intercom'
require 'intercom_event_wrapper'

Usage

Before, if you wanted to use intercom api and wanted to create an event, you had to do something like this:

::Intercom.app_id = "your_app_id"
::Intercom.app_api_key = "your_app_api_key"
... # somewhere later
::Intercom::Event.create your_event_data

However, if you wanted to create events to different apps from a single service, you had to change the app_id and app_api_key before use. This is prone to race conditions in an asynchronous or multithreaded program.

With this wrapped you can instead just create an event like that

::Intercom::EventWrapper.create your_event_data, your_app_id, your_app_api_key

Disclaimer

You are free to use and modify this wrapper in any way you want. You can also send me (pull)requests to update or add something new to it. I, however, will take no responsibility over anything you do with this library.