Configuration

You can initialize the Kustomer SDK with your API key and options.

import KustomerChat from '@kustomer/chat-react-native';
import type { KustomerOptions } from '@kustomer/chat-react-native';

const KUSTOMER_API_KEY = process.env.KUSTOMER_API_KEY; // Your Kustomer API key

const kustomerOptions: KustomerOptions = {
  // options for the Kustomer SDK
};

KustomerChat.configure(KUSTOMER_API_KEY, kustomerOptions);

Options

OptionTypeDefaultiOSAndroidDescription
enableUIbooleantrueEnables the Kustomer UI. Changing the default value is not yet supported.
showInAppNotificationsbooleanfalseShow in-app notifications for new messages.
languagebooleandeviceThe language to show volume control, automated messages, snippets, and KB for.
activeAssistantstringundefinedIf supplied, always uses this chat assistant ID when pressing new conversation button in the UI.
hideNewConversationButtonbooleanfalseNever show the "New Conversation" button.
hostDomainstringundefinedOverride the API host domain.
businessScheduleIdstringundefinedThe business schedule ID you want the app to use.
brandIdstringundefinedThe brand ID for the brand settings you'd like to present.
logLevelinfo, error, debug, warning, allKustomerLogType.allThe highest KustomerLogType you want to have printed to the console.
hideKbArticleSharebooleanfalseDon't show the Knowledge Base Article Share button.
hideHistoryNavigationbooleanfalseHides back button on conversation detail screen leading to chat history screen.
iosAnimate5StarbooleanfalseShow animation when customer selects the highest CSAT rating.
disablePushbooleanfalseSee details and context in iOS Push Notifications guide.
pushBundleIdstringapp.bundleIdentifierThe bundle ID for your app, if you need to override the default from your Bundle.
pushEnvironment"production", "development"productionThe PubNub push environment for your app.

Configuration errors

If for any reason the SDK fails to initialize, you will receive an error as a
Promise rejection.

KustomerChat.configure(KUSTOMER_API_KEY, kustomerOptions)
  .then(() => {
    // SDK initialized successfully
  })
  .catch((error) => {
    // SDK failed to initialize
    console.error(error); // should contain information about the error
  });