Skip to content

Latest commit

 

History

History
267 lines (160 loc) · 6.66 KB

README.md

File metadata and controls

267 lines (160 loc) · 6.66 KB

glia-widgets-ionic

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.

Installation

To install the @salemove/widgets_sdk_ionic package use:

npm install @salemove/widgets_sdk_ionic --legacy-peer-deps

How to use GliaSDK in Ionic environment

// 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();

API

configure(...)

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()

presentEntryWidget() => Promise<void>

Presents Entry Widget.


startChat()

startChat() => Promise<void>

Starts a new chat/text engagement with queue identifiers. If queueIds is null or empty, creates engagement for default queue.


startAudio()

startAudio() => Promise<void>

Starts a new audio engagement with queue identifiers. If queueIds is null or empty, creates engagement for default queue.


startVideo()

startVideo() => Promise<void>

Starts a new video engagement for queue identifiers. If queueIds is null or empty, creates engagement for default queue.


startSecureConversation()

startSecureConversation() => Promise<void>

Starts Secure Conversation flow. Secure Conversation requires authentication/IdToken.


clearVisitorSession()

clearVisitorSession() => Promise<void>

Recreates currently used visitor in SDK.


listQueues()

listQueues() => Promise<any>

Fetches all queues with its info for current site.


showVisitorCodeViewController()

showVisitorCodeViewController() => Promise<void>

Presents GliaWidgets UI with visitor code for sharing with operator to start an engagement.


authenticate(...)

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()

deauthenticate() => Promise<void>

Deauthenticates visitor. Be aware that deauthentication process relies on AuthenticationBehavior


isAuthenticated()

isAuthenticated() => Promise<void>

Provides current authentication state.


refreshAuthentication(...)

refreshAuthentication(options: { idToken: string; accessToken?: string; }) => Promise<void>

Refreshes authentication access properties.

Param Type
options { idToken: string; accessToken?: string; }

pauseLiveObservation()

pauseLiveObservation() => Promise<void>

Makes a pause for ongoing LiveObservation session.


resumeLiveObservation()

resumeLiveObservation() => Promise<void>

Resumes ongoing LiveObservation session.


Interfaces

ApiKey

Prop Type
id string
secret string

Type Aliases

Region

Site's region.

'us' | 'eu' | 'beta'

AuthenticationBehavior

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'