This page describes Model of the Channel Talk React Native SDK (hereafter referred to as SDK).

BootConfig

Configures option for ChannelIO.boot. This model is used as a parameter for the boot method. For the example, See QuickStart.

fieldtypedescription
pluginKeystringPlugin Key of Channel.
memberId(optional) stringAn identifier to distinguish each member user.
memberHash(optional) stringA HMAC-SHA256 value of memberId. See enabling member hash.
profile(optional) ProfileA user’s Profile.
language(optional) LanguageA user’s language.
It is valid when creating a new user. The language of the user that already exists will not change.
unsubscribeEmail(optional) booleanSets whether to receive marketing messages via email.
unsubscribeTexting(optional) booleanSets whether to receive marketing messages via texting (SMS, LMS)
trackDefaultEvent(optional) booleanSets whether to track the default event such as PageView.
hidePopup(optional) booleanSets whether hide popups such as marketing popup and in-app notifications.
channelButtonOption(optional) ChannelButtonOptionAn option for Channel button.
You can set the position and margin of the Channel button. The unit of margin is pt (point).
bubbleOption(optional) BubbleOptionAn option for popups for bubble type of marketing messages, and in-app notifications. The unit of margin is pt (point.)
appearanceAppearanceSets the appearance of SDK.
const config = {
  "pluginKey": YOUR_PLUGIN_KEY,
  "memberId": MEMBER_ID,
  "memberHash": MEMBER_HASH,
  "profile": {
    "name": NAME,
    "email": EMAIL,
    "mobileNumber": "+~~~",
    "avatarUrl": AVATAR_URL,
    OTHER_KEY: OTHER_VALUE,
  },
  "language": LANGUAGE, // "en", "ko", "jp"
  "unsubscribeEmail": BOOLEAN,
  "unsubscribeTexting": BOOLEAN,
  "trackDefaultEvent": BOOLEAN,
  "hidePopup": BOOLEAN,
  "channelButtonOption": {
    "xMargin": 16,
    "yMargin": 16,
    "position": POSITION,  // "left", "right"
  },
  "bubbleOption": {
    "yMargin": 30,
    "position" POSITION,   // "top", "bottom"
  }
  "appearance": APPEARANCE // "system", "light", "dark"
}

ChannelIO.boot(config).then((result) => {
  // result.status
  // result.user
})

Language

Languages that the SDK supports.

// Set language to Korean
"language": "ko"

// Set language to Japanese
"language": "jp"

// Set language to English
"language": "en"

ChannelButtonOption

An option for modifying the position of Channel button.
You can set it left down or right down. The default value of position is right, the margin is 20 for each.

"channelButtonOption": {
  "xMargin": 16,
  "yMargin": 16,
  "position": POSITION,  // 'left', 'right'
}

BubbleOption

Sets the location and margin of the message and bubble-type marketing messages in the in-app.
Location defaults to top and margins default to 20 .

"bubbleOption": {
  "position": "top", // "top" or "bottom"
  "yMargin": 0
}

ChannelButtonIcon

Sets the appearance of the Channel button icon.

"channel"
"chatBubbleFilled"
"chatProgressFilled"
"chatQuestionFilled"
"chatLightningFilled"
"chatBubbleAltFilled"
"smsFilled"
"commentFilled"
"sendForwardFilled"
"helpFilled"
"chatProgress"
"chatQuestion"
"chatBubbleAlt"
"sms"
"comment"
"sendForward"
"communication"
"headset"

Profile

A user’s profile.

fieldtypedescription
name(optional) stringA name of a user.
email(optional) stringA email of a user.
mobileNumber(optional) stringA mobile number of a user
avatarUrl(optional) stringAn avatar URL of a user.
"profile": {
  "name": NAME,
  "email": EMAIL,
  "mobileNumber": "+~~~",
  "avatarUrl": AVATAR_URL,
  OTHER_KEY: OTHER_VALUE,
}

User

An user who has visited a website or app with Channel Talk SDK installed.

FieldTypeDescription
idstringAn identifier that Channel Talk uses.
memberId(optional) stringAn identifier to distinguish member users. Anonymous user is null.
name(optional) stringA name of the user.
avatarUrl(optional) stringAn avatar URL of the user.
profile(optional) objectAn object that contains the user’s profile.
alertnumberThe number of important notifications that the user has not read. It is displayed as a number on the Channel button.
unreadnumberThe number of all unread notifications the user has. It includes the number of alert. It is displayed as a red dot on the Channel button.
tags(optional) stringA tag list of the user.
languageLanguageA language of the user.
unsubscribeTexting(optional) booleanWhether to receive marketing messages via email.
unsubscribeEmail(optional) booleanWhether to receive marketing messages via texting (SMS, LMS)
const user = {
  "id": ID,
  "memberId": MEMBER_ID,
  "name": NAME,
  "avatarUrl": AVATAR_URL,
  "alert": ALERT_COUNT,
  "unread": UNREAD_COUNT, 
  "profile": {
    "name": PROFILE_NAME,
    "mobileNumber": "+~~~",
    "CUSTOM_VALUE_1": "VALUE_1",
    "CUSTOM_VALUE_2": "VALUE_2"
  }
  "unsubscribeEmail": BOOLEAN,}
  "unsubscribeTexting": BOOLEAN,
  "tags": ["1", "2", "3"],
  "language": LANGUAGE
}

PopupData

Data of the in-app popup.

FieldTypeDescription
chatIdstringA chat Id of the popup.
avatarURLstringA avatar URL of the popup.
namestringA name which displayed on the popup.
messagestringA message which displayed on the popup.
const popupData = {
  "chatId": CHAT_ID,
  "avatarUrl": AVATAR_URL,
  "name": NAME,
  "message": MESSAGE,
}

UserData

A model used for data configuration on updateUser.

fieldtypedescription
languageLanguageA user’s language.
tags(optional) stringA user’s tag list.
Overwrite with tag data you add.
The maximum number is ten and is not case-sensitive.
profile(optional) objectA user’s profile.
Overwrite with profile data you add. Initialize if you set the profile value to nil.
profileOnce(optional) objectA profile to add to the user.
Add a new profile value it it does not exist.
unsubscribeEmail(optional) booleanWhether to receive marketing messages via email.
unsubscribeTexting(optional) booleanWhether to receive marketing messages via email.
const user = {
  "language": LANGUAGE, // "ko", "jp", "en"
  "tags": ["1", "2", "3"],
  "profile": {
    "name": NAME,
    "email": EMAIL,
    "mobileNumber": '+~~~',
    "avatarUrl": AVATAR_URL,
    OTHER_KEY: OTHER_VALUE,
  },
  "profileOnce": {
  },
  "unsubscribeEmail": BOOLEAN,
  "unsubscribeTexting": BOOLEAN,
};

ChannelIO.updateUser(user).then((result) => {
  // result.error
  // result.user
});

Appearance

An enum object for the appearance of the SDK.

// Set appearance to System
"appearance" : "system"

// Set appearance to Light
"appearance" : "light"

// Set appearance to Dark
"appearance" : "dark"

BootStatus

An enum object for the boot result.

fielddescription
successThe boot was successful.
notInitializedChannelIO.initialize was not called.
networkTimeoutThe boot failed because of a network issue.
notAvailableVersionNot a supported SDK version.
serviceUnderConstructionChannel Talk server is under construction.
requirePaymentThe channel is blocked or you need to check the subscription plan.
accessDeniedThe server responded with 4xx status code.
unknownAn unknown error.
"SUCCESS"
"NOT_INITIALIZED"
"NETWORK_TIMEOUT"
"NOT_AVAILABLE_VERSION"
"SERVICE_UNDER_CONSTRUCTION"
"REQUIRE_PAYMENT"
"ACCESS_DENIED"
"UNKNOWN_ERROR"