SDKs overview

Intercom provides a range of Software Development Kits (SDKs) and client libraries designed to facilitate integration with its customer messaging and engagement platform. These SDKs are available for various programming languages and mobile development environments, enabling developers to incorporate Intercom functionalities directly into their applications. The SDKs abstract the underlying RESTful API calls, providing idiomatic interfaces for common tasks such as managing users, conversations, and events. This approach aims to reduce development time and complexity when building applications that interact with Intercom's services, including the Intercom Messenger, Inbox, and customer data platform features.

The official SDKs are maintained by Intercom and are the recommended method for integration. Beyond these, the developer community has contributed additional libraries and wrappers, though their maintenance status and feature completeness may vary. Developers can refer to the official Intercom developer documentation for the most current information regarding SDK availability, usage, and best practices.

Official SDKs by language

Intercom offers official SDKs for both server-side and client-side applications, as well as mobile platforms. These SDKs are designed to provide a consistent and efficient way to interact with the Intercom API. The table below outlines the key official SDKs, their corresponding package names, typical installation methods, and general maturity levels.

Language/Platform Package/Module Installation Command (Example) Maturity
JavaScript (Web) Intercom Web Messenger <script> tag embed Stable, actively maintained
Ruby intercom gem install intercom Stable, actively maintained
Python intercom-python pip install intercom-python Stable, actively maintained
PHP intercom/intercom-php composer require intercom/intercom-php Stable, actively maintained
.NET (C#) Intercom.Dotnet dotnet add package Intercom.Dotnet Stable, actively maintained
Go go-intercom go get github.com/intercom/go-intercom Stable, actively maintained
Java intercom-java Maven/Gradle dependency Stable, actively maintained
iOS (Swift/Objective-C) Intercom for iOS CocoaPods/Swift Package Manager Stable, actively maintained
Android (Java/Kotlin) Intercom for Android Gradle dependency Stable, actively maintained
React Native react-native-intercom npm install react-native-intercom Stable, actively maintained
Flutter intercom_flutter flutter pub add intercom_flutter Stable, actively maintained

For detailed installation instructions and platform-specific prerequisites, developers should consult the official Intercom SDK installation guides.

Installation

Installation methods for Intercom SDKs vary by language and platform. The following sections provide general guidance for common environments. Specific versions and dependencies are typically outlined in the respective SDK documentation.

Web (JavaScript Messenger)

The Intercom Messenger for web applications is typically installed by embedding a JavaScript snippet directly into your HTML. This snippet loads the Messenger and makes it available globally. Configuration options are passed via a global window.intercomSettings object.

<script>
  window.intercomSettings = {
    app_id: "YOUR_APP_ID"
  };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/YOUR_APP_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();</script>

Replace YOUR_APP_ID with your actual Intercom application ID. More details are available in the Intercom Messenger for Web installation guide.

Server-Side (Ruby, Python, PHP, .NET, Go, Java)

Server-side SDKs are typically installed using the language's package manager. After installation, you initialize the client with your Intercom Access Token, which can be generated in your Intercom workspace settings.

Ruby

# Gemfile
gem 'intercom'

# Terminal
bundle install

Python

pip install intercom-python

PHP

composer require intercom/intercom-php

.NET (C#)

dotnet add package Intercom.Dotnet

Go

go get github.com/intercom/go-intercom

Java

For Java, you typically add a dependency to your pom.xml (Maven) or build.gradle (Gradle) file.

<!-- Maven -->
<dependency>
    <groupId>io.intercom</groupId>
    <artifactId>intercom-java</artifactId>
    <version>X.Y.Z</version> <!-- Replace with latest version -->
</dependency>
// Gradle
implementation 'io.intercom:intercom-java:X.Y.Z' // Replace with latest version

Mobile (iOS, Android, React Native, Flutter)

Mobile SDKs are integrated using platform-specific package managers or build systems. They generally require platform-specific configuration within your project files (e.g., Info.plist for iOS, AndroidManifest.xml for Android).

iOS (Swift/Objective-C)

Using CocoaPods:

# Podfile
pod 'Intercom'
pod install

For Swift Package Manager or manual installation, refer to the Intercom iOS SDK installation documentation.

Android (Java/Kotlin)

Add the dependency to your app's build.gradle file:

// build.gradle (app-level)
dependencies {
    implementation 'io.intercom.android:sdk:X.Y.Z' // Replace with latest version
}

Consult the Intercom Android SDK installation guide for full details.

React Native

npm install react-native-intercom --save
cd ios && pod install && cd .. # For iOS linking

Flutter

flutter pub add intercom_flutter

Quickstart example

This example demonstrates how to initialize the Intercom API client and create a new user (or update an existing one) using the Python SDK, a common server-side operation. Similar patterns apply to other server-side SDKs.

import intercom

# Configure the Intercom client with your Access Token
# Replace 'YOUR_ACCESS_TOKEN' with your actual Intercom Access Token
# It's recommended to store your token securely, e.g., using environment variables.
intercom.app_id = 'YOUR_APP_ID'
intercom.api_base = 'https://api.intercom.io'
intercom.access_token = 'YOUR_ACCESS_TOKEN'

try:
    # Create or update a user
    # The 'external_id' is a unique identifier for your user in your system.
    # Intercom will create a new user if 'external_id' is not found, or update if it exists.
    user = intercom.User.create(
        email='[email protected]',
        name='Jane Doe',
        external_id='user_12345',
        custom_attributes={
            'plan': 'premium',
            'signed_up_at': 1678886400 # Unix timestamp for March 15, 2023
        }
    )
    print(f"User created/updated: {user.id} - {user.email}")

    # Send a message to the user
    message = intercom.Message.create(
        message_type='email',
        body='Hello from your service! We've updated your account.',
        template='plain',
        from_={'type': 'admin', 'id': 'YOUR_ADMIN_ID'}, # Replace with an Admin ID from your Intercom workspace
        to={'type': 'user', 'id': user.id}
    )
    print(f"Message sent: {message.id}")

    # Retrieve a user by external_id
    retrieved_user = intercom.User.find(external_id='user_12345')
    print(f"Retrieved user: {retrieved_user.name} ({retrieved_user.email})")

except intercom.errors.IntercomError as e:
    print(f"An Intercom API error occurred: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

Before running this code, ensure you have installed the intercom-python library (pip install intercom-python) and replaced YOUR_APP_ID, YOUR_ACCESS_TOKEN, and YOUR_ADMIN_ID with your actual Intercom credentials. Admin IDs can be found in your Intercom workspace settings under 'Team' or by inspecting the API response when fetching admin details. For robust authentication practices, consider using environment variables for sensitive credentials, as described in guides like the Google Cloud authentication documentation.

Community libraries

While Intercom provides a comprehensive set of official SDKs, the developer community has also created and maintained various libraries and wrappers for languages not officially supported or to offer alternative abstractions. These community-driven projects can sometimes provide solutions for niche use cases or different architectural preferences. However, it is important to note that community libraries may not always receive the same level of support, updates, or feature parity as official SDKs. Developers considering community options should evaluate their active maintenance, documentation, and compatibility with the latest Intercom API versions.

Examples of community contributions can often be found on platforms like GitHub, by searching for "Intercom API" combined with specific language names. For instance, developers might find unofficial clients for languages such as Node.js (beyond the official Messenger), Elixir, or Rust. Always review the project's repository for license information, contribution guidelines, and recent activity before integrating it into a production environment. For the most up-to-date and officially supported integration methods, refer to the official Intercom developer resources.