Skip to content

Commit

Permalink
Glia Widgets Ionic Plugin 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dukhovnyi committed Dec 5, 2024
1 parent 9f7cde8 commit 122402e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 59 deletions.
89 changes: 32 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ GliaWidgets SDK is a simple and customisable framework built on top of GliaSDK.

## Installation

To install this package, add the following to your `.npmrc` file:
To install this package use:

```text
@salemove:registry=https://npm.pkg.github.com
```

then run

```shell
npm install @your-username/ionic-plugin-example
npm install git+https://github.com/salemove/widgets_sdk_ionic.git
```

# How to use GliaSDK in Ionic environment
Expand All @@ -38,22 +32,22 @@ GliaSdk.startAudio();

<docgen-index>

* [`configure(...)`](#configure)
* [`startChat(...)`](#startchat)
* [`startAudio(...)`](#startaudio)
* [`startVideo(...)`](#startvideo)
* [`startSecureConversation(...)`](#startsecureconversation)
* [`clearVisitorSession()`](#clearvisitorsession)
* [`listQueues()`](#listqueues)
* [`showVisitorCodeViewController()`](#showvisitorcodeviewcontroller)
* [`authenticate(...)`](#authenticate)
* [`deauthenticate()`](#deauthenticate)
* [`isAuthenticated()`](#isauthenticated)
* [`refreshAuthentication(...)`](#refreshauthentication)
* [`pauseLiveObservation()`](#pauseliveobservation)
* [`resumeLiveObservation()`](#resumeliveobservation)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
- [`configure(...)`](#configure)
- [`startChat(...)`](#startchat)
- [`startAudio(...)`](#startaudio)
- [`startVideo(...)`](#startvideo)
- [`startSecureConversation(...)`](#startsecureconversation)
- [`clearVisitorSession()`](#clearvisitorsession)
- [`listQueues()`](#listqueues)
- [`showVisitorCodeViewController()`](#showvisitorcodeviewcontroller)
- [`authenticate(...)`](#authenticate)
- [`deauthenticate()`](#deauthenticate)
- [`isAuthenticated()`](#isauthenticated)
- [`refreshAuthentication(...)`](#refreshauthentication)
- [`pauseLiveObservation()`](#pauseliveobservation)
- [`resumeLiveObservation()`](#resumeliveobservation)
- [Interfaces](#interfaces)
- [Type Aliases](#type-aliases)

</docgen-index>

Expand All @@ -74,8 +68,7 @@ NB! To make plugin work properly, use `create-visitor` credentials for Site APIK
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`options`** | <code>{ siteId: string; apiKey: <a href="#apikey">ApiKey</a>; region: <a href="#region">Region</a>; companyName: string; overrideLocale?: string; }</code> |

--------------------

---

### startChat(...)

Expand All @@ -89,8 +82,7 @@ Starts a new chat/text engagement with queue identifiers. If `queueIds` is null
| ------------- | ------------------------------------- |
| **`options`** | <code>{ queueIds?: string[]; }</code> |

--------------------

---

### startAudio(...)

Expand All @@ -104,8 +96,7 @@ Starts a new audio engagement with queue identifiers. If `queueIds` is null or e
| ------------- | ------------------------------------- |
| **`options`** | <code>{ queueIds?: string[]; }</code> |

--------------------

---

### startVideo(...)

Expand All @@ -119,8 +110,7 @@ Starts a new video engagement for queue identifiers. If `queueIds` is null or em
| ------------- | ------------------------------------- |
| **`options`** | <code>{ queueIds?: string[]; }</code> |

--------------------

---

### startSecureConversation(...)

Expand All @@ -135,8 +125,7 @@ Secure Conversation requires authentication/IdToken.
| ------------- | --------------------------------------------------------------------------------------------------------- |
| **`options`** | <code>{ startScreen: <a href="#secureconversationstartscreen">SecureConversationStartScreen</a>; }</code> |

--------------------

---

### clearVisitorSession()

Expand All @@ -146,8 +135,7 @@ clearVisitorSession() => Promise<void>

Recreates currently used visitor in SDK.

--------------------

---

### listQueues()

Expand All @@ -159,8 +147,7 @@ Fetches all queues with its info for current site.

**Returns:** <code>Promise&lt;any&gt;</code>

--------------------

---

### showVisitorCodeViewController()

Expand All @@ -170,8 +157,7 @@ showVisitorCodeViewController() => Promise<void>

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

--------------------

---

### authenticate(...)

Expand All @@ -185,8 +171,7 @@ Authenticates visitor.
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **`options`** | <code>{ behavior: <a href="#authenticationbehavior">AuthenticationBehavior</a>; idToken: string; accessToken?: string; }</code> | - Provides options for authentication such as behavior, idToken, and accessToken. |

--------------------

---

### deauthenticate()

Expand All @@ -196,8 +181,7 @@ deauthenticate() => Promise<void>

Deauthenticates visitor. Be aware that deauthentication process relies on <a href="#authenticationbehavior">`AuthenticationBehavior`</a>

--------------------

---

### isAuthenticated()

Expand All @@ -207,8 +191,7 @@ isAuthenticated() => Promise<void>

Provides current authentication state

--------------------

---

### refreshAuthentication(...)

Expand All @@ -222,8 +205,7 @@ Refreshes authentication access properties.
| ------------- | ------------------------------------------------------- |
| **`options`** | <code>{ idToken: string; accessToken?: string; }</code> |

--------------------

---

### pauseLiveObservation()

Expand All @@ -233,8 +215,7 @@ pauseLiveObservation() => Promise<void>

Makes a pause for ongoing LiveObservation session.

--------------------

---

### resumeLiveObservation()

Expand All @@ -244,37 +225,31 @@ resumeLiveObservation() => Promise<void>

Resumes ongoing LiveObservation session.

--------------------

---

### Interfaces


#### ApiKey

| Prop | Type |
| ------------ | ------------------- |
| **`id`** | <code>string</code> |
| **`secret`** | <code>string</code> |


### Type Aliases


#### Region

Site's region.

<code>'us' | 'eu' | 'beta'</code>


#### SecureConversationStartScreen

Start screen for Secure Conversation flow.

<code>'welcome' | 'chatTranscript'</code>


#### AuthenticationBehavior

Authentication (IdToken) behavior.
Expand Down
16 changes: 14 additions & 2 deletions example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
"version": "1.0.0",
"description": "An Amazing Capacitor App",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"files": [
"dist"
],
"keywords": [
"capacitor",
"mobile"
Expand All @@ -25,5 +37,5 @@
"vite": "^5.4.2"
},
"author": "",
"license": "ISC"
}
"license": "MIT"
}

0 comments on commit 122402e

Please sign in to comment.