nativescript-zendesk-chat-ui
by rhanb | v1.0.0
Your awesome NativeScript plugin.
npm i --save nativescript-zendesk-chat-ui

NativeScript Zendesk Chat UI

Exposes Zendesk Chat SDK for iOS and Android.

Installation

Describe your plugin installation steps. Ideally it would be something like:

tns plugin add nativescript-zendesk-chat-ui

Usage

ZendeskChatUi.initialize(key); // your key here
ZendeskChatUi.startChat(); // start a chat

API

ZendeskChatUi

Method Default Description
startChat(chatConfig?: ChatConfig) null Start a chat with a chat configuration.
initialize(accountKey: string) null your zendesk chat account key. required.
trackEvent(eventDescription: string) null track event.
Property Default Description
visitorInfo: VisitorInfo null set user's the email, name, phone number, note.
chatOverlayEnabled: boolean true hide the chat overlay. iOS only

VisitorInfo

export interface VisitorInfo {
name?: string;
email?: string;
phoneNumber?: string;
note?: string;
}

ChatConfig

export interface ChatConfig {
department?: string;
tags?: string[];
uploadAttachmentsEnabled?: boolean; // ios only
preChatDataRequirements?: { // required fields the user will have to fill
department: PreChatDataRequirement;
email: PreChatDataRequirement;
message: PreChatDataRequirement;
name: PreChatDataRequirement;
phone: PreChatDataRequirement;
};
}

PreChatDataRequirement

export enum PreChatDataRequirement {
NotRequired = 0,
Optional = 1,
Required = 2,
OptionalEditable = 3,
RequiredEditable = 4
}

Customization

For customization, please refer to the iOS and Android documentation.

License

Apache License Version 2.0, January 2004