@livechat/customer-sdk 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/dist/customer-sdk.cjs.js +187 -640
- package/dist/customer-sdk.cjs.native.js +187 -639
- package/dist/customer-sdk.esm.js +188 -641
- package/dist/customer-sdk.js +265 -867
- package/dist/customer-sdk.min.js +1 -1
- package/package.json +10 -9
- package/types/actions.d.ts +331 -0
- package/types/chatHistory.d.ts +19 -0
- package/types/clientDataParsers.d.ts +55 -0
- package/types/completionValues.d.ts +4 -0
- package/types/constants/clientErrorCodes.d.ts +11 -0
- package/types/constants/connectionStatuses.d.ts +6 -0
- package/types/constants/eventTypes.d.ts +8 -0
- package/types/constants/reduxActions.d.ts +23 -0
- package/types/constants/serverDisconnectionReasons.d.ts +15 -0
- package/types/constants/serverErrorCodes.d.ts +23 -0
- package/types/constants/serverPushActions.d.ts +26 -0
- package/types/constants/serverRequestActions.d.ts +30 -0
- package/types/constants/sortOrders.d.ts +3 -0
- package/types/constants/userTypes.d.ts +3 -0
- package/types/createError.d.ts +9 -0
- package/types/createStore.d.ts +12 -0
- package/types/debug.d.ts +3 -0
- package/types/graylog/index.d.ts +14 -0
- package/types/graylog/makeGrayLogRequest.d.ts +2 -0
- package/types/graylog/makeGrayLogRequest.native.d.ts +6 -0
- package/types/index.d.ts +239 -0
- package/types/reducer.d.ts +546 -0
- package/types/sendRequestAction.d.ts +4 -0
- package/types/sendTicketForm.d.ts +14 -0
- package/types/serverDataParser.d.ts +34 -0
- package/types/serverEventParser.d.ts +12 -0
- package/types/serverFrameParser.d.ts +385 -0
- package/types/sideEffects/checkGoals.d.ts +5 -0
- package/types/sideEffects/index.d.ts +12 -0
- package/types/sideStorage.d.ts +5 -0
- package/types/socketClient.d.ts +11 -0
- package/types/socketListener.d.ts +9 -0
- package/types/thunks.d.ts +4 -0
- package/types/types/actions.d.ts +157 -0
- package/types/types/clientEntities.d.ts +374 -0
- package/types/types/frames.d.ts +635 -0
- package/types/types/serverEntities.d.ts +408 -0
- package/types/types/state.d.ts +56 -0
- package/types/uploadFile.d.ts +19 -0
- package/types/validateFile/index.d.ts +3 -0
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ Or use the node-style `require` call:
|
|
|
63
63
|
|
|
64
64
|
### Using a script tag - UMD module hosted on unpkg's CDN
|
|
65
65
|
|
|
66
|
-
`<script src="https://unpkg.com/@livechat/customer-sdk@3.1.
|
|
66
|
+
`<script src="https://unpkg.com/@livechat/customer-sdk@3.1.1"></script>`
|
|
67
67
|
|
|
68
68
|
If you just want to look around and play with the SDK, check out our
|
|
69
69
|
[sample chat widget implementation](https://codesandbox.io/s/rm3prxw88n).
|
|
@@ -83,7 +83,8 @@ Other optional configuration parameters are also available:
|
|
|
83
83
|
| licenseId | number | | Your license number, you receive this value when creating a new livechat account. |
|
|
84
84
|
| clientId | string | | Your client id, you receive this value when you register your application in the LiveChat Developer Console. |
|
|
85
85
|
| autoConnect | boolean | true | Optional; should the library try to reconnect on it's own. |
|
|
86
|
-
| groupId | number |
|
|
86
|
+
| groupId | number | | Optional; the id of the group you wish to connect to. |
|
|
87
|
+
| uniqueGroups | boolean | false | Optional; by default, the customer's identity is the same for all groups. If you want to create a separate customer identity for each group, set this parameter to `true`. When set to `true`, passing a `groupId` is required. |
|
|
87
88
|
| region | 'dal' \| 'fra' | 'dal' | Optional; the server region your license is at. |
|
|
88
89
|
| redirectUri | string | | Optional; should only be used inside ReactNative, this is the URI which your webview is redirected to after authorization. |
|
|
89
90
|
| customerDataProvider | () => CustomerData | | Optional; should only be used if you need to send customer data during login. In general, [`updateCustomer()`](#updateCustomer) should be prefered for sending customer data. |
|
|
@@ -358,8 +359,29 @@ customerSDK
|
|
|
358
359
|
|
|
359
360
|
Starts the connection process to our servers. It is needed when:
|
|
360
361
|
|
|
361
|
-
-
|
|
362
|
-
|
|
362
|
+
- The `autoConnect: false` argument has been passed to the `init` method.
|
|
363
|
+
|
|
364
|
+
```js
|
|
365
|
+
const customerSDK = CustomerSDK.init({
|
|
366
|
+
licenseId: LICENSE_ID,
|
|
367
|
+
clientId: CLIENT_ID,
|
|
368
|
+
autoConnect: false,
|
|
369
|
+
})
|
|
370
|
+
|
|
371
|
+
/* later in the code... */
|
|
372
|
+
|
|
373
|
+
customerSDK.connect()
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
- You get disconnected for a reason that suspends reconnection attempts (e.g. [`inactivity_timeout`](#inactivity_timeout)).
|
|
377
|
+
|
|
378
|
+
```js
|
|
379
|
+
customerSDK.on('disconnected', ({ reason }) => {
|
|
380
|
+
if (reason === 'inactivity_timeout') {
|
|
381
|
+
customerSDK.connect()
|
|
382
|
+
}
|
|
383
|
+
})
|
|
384
|
+
```
|
|
363
385
|
|
|
364
386
|
## deactivateChat
|
|
365
387
|
|
|
@@ -2175,6 +2197,12 @@ customerSDK.on('disconnected', ({ reason }) => {
|
|
|
2175
2197
|
|
|
2176
2198
|
# Changelog
|
|
2177
2199
|
|
|
2200
|
+
## [v3.1.2] - 2023-02-28
|
|
2201
|
+
|
|
2202
|
+
### Fixed
|
|
2203
|
+
|
|
2204
|
+
- Fixed situations when a value for `urlDetails.imageUrl` available in the `getUrlInfo` method could sometimes return a URL with a duplicated protocol (like "https://https://...")
|
|
2205
|
+
|
|
2178
2206
|
## [v3.1.0] - 2021-10-7
|
|
2179
2207
|
|
|
2180
2208
|
### Added
|