Kustomer SDK V2 React Native

This is a wrapper for Kustomer v2 Sdk for react native. This implements the kustomer v2 for android and ios.
Functions available for android and ios are available on react native.

Getting started

$ npm install react-native-kustomer-sdk-v2 --save


$ yarn add react-native-kustomer-sdk-v2


  • Android minSdkVersion 21
  • iOS level 11

Android ( Important )

For android to register the api key

Add the following dependancies in build.gradle (App)

dependencies {
  implementation 'com.kustomer.chat:ui:2.9.2'

Add the code at last inside onCreate() in MainApplication.java

//Add these import files
import kotlin.jvm.functions.Function1;
import com.kustomer.ui.KustomerOptions;
import com.reactnativekustomersdk.KustomerSdkPackage;
import com.kustomer.ui.Kustomer;  // Added for customer
import android.widget.Toast;
import com.kustomer.core.models.KusResult;
import kotlin.Unit;


public  void  onCreate()  {
	try {
	    Kustomer.Companion.init(this, "Enter-api-key-here", (KustomerOptions) null, (result) -> {
		    return Unit.INSTANCE;
	catch (AssertionError e) {
		Toast toast= Toast.makeText(getApplicationContext(),"API KEY IS INVALID",Toast.LENGTH_SHORT);
}// onCreate closing bracket

The above code will show the toast if the API key is invalid.

  • In case of allowBackup error
    set android:allowBackup="true" in the AndroidManifest.xml file

Import the library to use its methods:

import * as KustomerSDK from "react-native-kustomer-sdk-v2";
import { open, login, logout } from "react-native-kustomer-sdk-v2";

Call initialize function at start in react native with the api key to register the Api key for iOS.

import { initialize } from "react-native-kustomer-sdk-v2";
initialize('Enter-API-Key'); // Add this when the app will mount

import * as KustomerSDK from "react-native-kustomer-sdk-v2";
KustomerSDK.initialize('Enter-API-Key'); // Add this when the app will mount


After installing the react-native-kustomer-sdk-v2 do pod install inside the ios folder.

pod install 


  • initialize(apiKey: String): Promise<number>

Initializes the apiKey to customer sdk. It is only required for ios and would cause no side effects on android.

  • isLoggedIn(email: String): Promise<number>

Calls the isLoggedIn function in the kustomer sdk. It checks whether the use is logged in.

  • logIn(jwt: String): Promise<number>

Calls the logIn function in the kustomer sdk. It checks whether the use is logged in. To generate the jwt token use this code

KustomerSDK.logIn('Enter-JWT-token here').then(...);
  • logOut(): Promise<number>

Calls the logOut function in the kustomer sdk. It checks whether the user is logged in.

  • open(type: openTypes): Promise<number>

Calls the open function in the kustomer sdk. Open the chat with one of the following types.

type  openTypes  =  'default'  |  'chat_kb'  |  'chat_only'  |  'kb_only';
  • openNewConversation(initialMessage: string, animated?:boolean): Promise<string>

Calls the openNewConversation function in the kustomer sdk. Open the conversation with initial Message.
Animated param is only available for iOS.

KustomerSDK.openNewConversation('intial_message').then(...); //Android
KustomerSDK.openNewConversation('intial_message',true).then(...); //iOS
  • openConversationByID(conversationID: string): Promise<string>

Calls the openConversationByID function in the kustomer sdk. Open the conversaton by id.

  • getUnreadCount(): Promise<number>

Calls the getUnreadCount function in the kustomer sdk. Returns the number unreadMessages.

  • openKBbyID(kbID:string): Promise<boolean>

Calls the openKBbyID function in the kustomer sdk. Opens the knowledge base by id.

  • setActiveAssistant(assistantID:string): Promise<boolean>

Calls the setActiveAssistant function in the kustomer sdk. Sets the active assistant to the assistantID.

  • getOpenConversationCount(): Promise<boolean>

Calls the getOpenConversationCountfunction in the kustomer sdk. Check the kustomer documentation for more description.

  • closeChat(): Promise<boolean> | void

Calls the closeChat function in the kustomer sdk. Closes the chat. Only available for iOS.

  • chatVisible(): Promise<boolean> | void

Calls the chatVisiblefunction in the kustomer sdk. Returns if the chat is visible. Only available for iOS.


Manual Installation



Include the library in your android/app/build.gradle:

implementation 'com.kustomer.chat:ui:2.9.+'



The preferred installation method is with CocoaPods. Add the following to your Podfile:

pod 'KustomerChat'


To contribute fork repository and make the nessecary changes.
Raise a PR for the same.
Mention iOS/Android/RN in the PR.
Mention fix/feature/refactor in the PR.


In case of error please raise a issue.

While development do following if error occurs.

  • Set android:allowBackup=”true” in the AndroidManifest.xml file (Android)
  • comment flipper in the Podfile (iOS)
  • add use_framework! in the Podfile (iOS)


View Github