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 the @salemove/widgets_sdk_ionic package use:
npm install @salemove/widgets_sdk_ionic --legacy-peer-deps
// Import `glia-widgets-ionic` SDK
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',
});
// Show Entry Widget
GliaSdk.presentEntryWidget();
configure(...)
presentEntryWidget()
startChat()
startAudio()
startVideo()
startSecureConversation()
clearVisitorSession()
listQueues()
showVisitorCodeViewController()
authenticate(...)
deauthenticate()
isAuthenticated()
refreshAuthentication(...)
pauseLiveObservation()
resumeLiveObservation()
- Interfaces
- Type Aliases
configure(options: { siteId: string; queueIds?: string[]; apiKey: ApiKey; region: Region; companyName: string; overrideLocale?: string; }) => Promise<void>
Configures GliaWidgets SDK with credentials.
NB! Ensure the site API key used in Mobile SDK has the Create Visitor permission only.
Param | Type |
---|---|
options |
{ siteId: string; queueIds?: string[]; apiKey: ApiKey; region: Region; companyName: string; overrideLocale?: string; } |
presentEntryWidget() => Promise<void>
Presents Entry Widget.
startChat() => Promise<void>
Starts a new chat/text engagement with queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
startAudio() => Promise<void>
Starts a new audio engagement with queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
startVideo() => Promise<void>
Starts a new video engagement for queue identifiers. If queueIds
is null or empty, creates engagement for default queue.
startSecureConversation() => Promise<void>
Starts Secure Conversation flow. Secure Conversation requires authentication/IdToken.
clearVisitorSession() => Promise<void>
Recreates currently used visitor in SDK.
listQueues() => Promise<any>
Fetches all queues with its info for current site.
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'
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'