GliaWidgets SDK is a simple and customisable framework built on top of GliaSDK. It provides all the necessary UI components to quickly integrate GliaSDK into your project.
To install version 1.0.0 of this package use:
npm install github:salemove/widgets_sdk_ionic#1.0.0
// Import `glia-widgets-ionic` plugin
import { GliaSdk } from 'glia-widgets-ionic';
// Configure SDK
GliaSdk.configure({
siteId: 'site-id',
apiKey: { id: 'api-key-id', secret: 'api-key-secret' },
region: 'us',
companyName: 'Ionic Company',
});
// Start engagement
GliaSdk.startAudio();
configure(...)
startChat(...)
startAudio(...)
startVideo(...)
startSecureConversation(...)
clearVisitorSession()
listQueues()
showVisitorCodeViewController()
authenticate(...)
deauthenticate()
isAuthenticated()
refreshAuthentication(...)
pauseLiveObservation()
resumeLiveObservation()
- Interfaces
- Type Aliases
configure(options: { siteId: string; apiKey: ApiKey; region: Region; companyName: string; overrideLocale?: string; }) => Promise<void>
configures GliaWidgets SDK with credentials.
NB! To make plugin work properly, use create-visitor
credentials for Site APIKey only.
Param | Type |
---|---|
options |
{ siteId: string; apiKey: ApiKey; region: Region; companyName: string; overrideLocale?: string; } |
startChat(options: { queueIds?: string[]; }) => Promise<void>
Starts a new chat/text engagement with queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
Param | Type |
---|---|
options |
{ queueIds?: string[]; } |
startAudio(options: { queueIds?: string[]; }) => Promise<void>
Starts a new audio engagement with queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
Param | Type |
---|---|
options |
{ queueIds?: string[]; } |
startVideo(options: { queueIds?: string[]; }) => Promise<void>
Starts a new video engagement for queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
Param | Type |
---|---|
options |
{ queueIds?: string[]; } |
startSecureConversation(options: { startScreen: SecureConversationStartScreen; }) => Promise<void>
Starts Secure Conversation flow with passed start screen
.
Secure Conversation requires authentication/IdToken.
Param | Type |
---|---|
options |
{ startScreen: SecureConversationStartScreen; } |
clearVisitorSession() => Promise<void>
Recreates currently used visitor in SDK.
listQueues() => Promise<any>
Fetches all queues with its info for current site.
Returns: Promise<any>
showVisitorCodeViewController() => Promise<void>
Presents GliaWidgets UI with visitor code for sharing with operator to start an engagement.
authenticate(options: { behavior: AuthenticationBehavior; idToken: string; accessToken?: string; }) => Promise<void>
Authenticates visitor.
Param | Type | Description |
---|---|---|
options |
{ behavior: AuthenticationBehavior; idToken: string; accessToken?: string; } |
- Provides options for authentication such as behavior, idToken, and accessToken. |
deauthenticate() => Promise<void>
Deauthenticates visitor. Be aware that deauthentication process relies on AuthenticationBehavior
isAuthenticated() => Promise<void>
Provides current authentication state
refreshAuthentication(options: { idToken: string; accessToken?: string; }) => Promise<void>
Refreshes authentication access properties.
Param | Type |
---|---|
options |
{ idToken: string; accessToken?: string; } |
pauseLiveObservation() => Promise<void>
Makes a pause for ongoing LiveObservation session.
resumeLiveObservation() => Promise<void>
Resumes ongoing LiveObservation session.
Prop | Type |
---|---|
id |
string |
secret |
string |
Site's region.
'us' | 'eu' | 'beta'
Start screen for Secure Conversation flow.
'welcome' | 'chatTranscript'
Authentication (IdToken) behavior. forbiddenDuringEngagement - Prevent creation a new engagement if ongoing engagement exists. Default behavior. allowedDuringEngagement - Allows creation a new engagement if ongoing engagement exists. During this behavior original engagement will be ended and a new engagement engagement will be restarted with the same operator after authentication is succeded.
'forbiddenDuringEngagement' | 'allowedDuringEngagement'