@livechat/customer-sdk 3.1.1 → 3.1.3
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 +24 -10
- package/dist/customer-sdk.cjs.js +243 -673
- package/dist/customer-sdk.cjs.native.js +243 -672
- package/dist/customer-sdk.esm.js +243 -671
- package/dist/customer-sdk.js +589 -1056
- package/dist/customer-sdk.min.js +1 -1
- package/package.json +9 -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/organizationIds.d.ts +2 -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 +245 -0
- package/types/reducer.d.ts +546 -0
- package/types/sendRequestAction.d.ts +4 -0
- package/types/sendTicketForm.d.ts +15 -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 +13 -0
- package/types/sideStorage.d.ts +5 -0
- package/types/socketClient.d.ts +11 -0
- package/types/socketListener.d.ts +12 -0
- package/types/thunks.d.ts +4 -0
- package/types/types/actions.d.ts +157 -0
- package/types/types/clientEntities.d.ts +376 -0
- package/types/types/frames.d.ts +635 -0
- package/types/types/serverEntities.d.ts +409 -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
|
@@ -69,21 +69,21 @@ 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).
|
|
70
70
|
|
|
71
71
|
For the time being you need to register your application in the <a href="https://developers.livechat.com/console" target="_blank">Developers Console</a>
|
|
72
|
-
as a "Web app (frontend, eg. JavaScript)" type. Then, you have to pass the configured `redirectUri` to the `init`, along with the regular required properties (`
|
|
72
|
+
as a "Web app (frontend, eg. JavaScript)" type. Then, you have to pass the configured `redirectUri` to the `init`, along with the regular required properties (`organizationId` and `clientId`).
|
|
73
73
|
|
|
74
74
|
## Using the API
|
|
75
75
|
|
|
76
76
|
To use the API you will first need to create an instance using the `init` function.
|
|
77
|
-
You will need to provide your
|
|
77
|
+
You will need to provide your organizationId and clientId when creating a Customer SDK instance.
|
|
78
78
|
|
|
79
79
|
Other optional configuration parameters are also available:
|
|
80
80
|
|
|
81
81
|
| parameters | type | default | description |
|
|
82
82
|
| -------------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
83
|
-
|
|
|
83
|
+
| organizationId | number | | Your Organization ID, 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 | 0 | Optional; the id of the group you wish to connect to. |
|
|
87
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. |
|
|
88
88
|
| region | 'dal' \| 'fra' | 'dal' | Optional; the server region your license is at. |
|
|
89
89
|
| redirectUri | string | | Optional; should only be used inside ReactNative, this is the URI which your webview is redirected to after authorization. |
|
|
@@ -111,7 +111,7 @@ The `init` function will return a Customer SDK instance:
|
|
|
111
111
|
|
|
112
112
|
```js
|
|
113
113
|
const customerSDK = CustomerSDK.init({
|
|
114
|
-
|
|
114
|
+
organizationId: ORGANIZATION_ID,
|
|
115
115
|
clientId: CLIENT_ID,
|
|
116
116
|
})
|
|
117
117
|
```
|
|
@@ -163,7 +163,7 @@ export default class App extends React.Component {
|
|
|
163
163
|
|
|
164
164
|
componentDidMount() {
|
|
165
165
|
this.customerSDK = init({
|
|
166
|
-
|
|
166
|
+
organizationId: ORGANIZATION_ID,
|
|
167
167
|
clientId: CLIENT_ID,
|
|
168
168
|
redirectUri: REDIRECT_URI,
|
|
169
169
|
})
|
|
@@ -1003,7 +1003,7 @@ Parameters:
|
|
|
1003
1003
|
### Errors
|
|
1004
1004
|
|
|
1005
1005
|
- `CHAT_ALREADY_ACTIVE` - the chat is already active and you can't activate it again.
|
|
1006
|
-
- `GROUPS_OFFLINE` - a group in the targeted chat is offline. It can happen
|
|
1006
|
+
- `GROUPS_OFFLINE` - a group in the targeted chat is offline. It can happen when asynchronous communication is disabled.
|
|
1007
1007
|
|
|
1008
1008
|
## sendEvent
|
|
1009
1009
|
|
|
@@ -1212,7 +1212,7 @@ Parameters:
|
|
|
1212
1212
|
### Errors
|
|
1213
1213
|
|
|
1214
1214
|
- `CHAT_LIMIT_REACHED` - the maximum limit of chats per Customer has been reached, and it's not possible to start a new one. You should activate one of the existing chats. The limit is 1.
|
|
1215
|
-
- `GROUPS_OFFLINE` - a group in the
|
|
1215
|
+
- `GROUPS_OFFLINE` - a group in the targeted chat is offline. It can happen when asynchronous communication is disabled.
|
|
1216
1216
|
|
|
1217
1217
|
## updateChatProperties
|
|
1218
1218
|
|
|
@@ -2085,11 +2085,11 @@ Internal error. Customer SDK reconnects on its own.
|
|
|
2085
2085
|
|
|
2086
2086
|
## License expired
|
|
2087
2087
|
|
|
2088
|
-
The
|
|
2088
|
+
The subscription for LiveChat product associated with the specified ID has expired. You should make sure that there are no unpaid invoices for it.
|
|
2089
2089
|
|
|
2090
2090
|
## License not found
|
|
2091
2091
|
|
|
2092
|
-
The
|
|
2092
|
+
The LiveChat product associated with the specified ID doesn't exist. You should check the options passed in to Customer SDK and make sure that the parameters provided are correct.
|
|
2093
2093
|
|
|
2094
2094
|
This internally destroys the current instance of Customer SDK, so it won't be possible to reuse it.
|
|
2095
2095
|
|
|
@@ -2197,6 +2197,20 @@ customerSDK.on('disconnected', ({ reason }) => {
|
|
|
2197
2197
|
|
|
2198
2198
|
# Changelog
|
|
2199
2199
|
|
|
2200
|
+
## [v4.0.0] - XXXX-XX-X
|
|
2201
|
+
|
|
2202
|
+
### Changed
|
|
2203
|
+
|
|
2204
|
+
Switched to using Customer API 3.4:
|
|
2205
|
+
|
|
2206
|
+
- Drop support for the `licenseId` parameter in the `init` method. It has been replaced by the `organizationId`.
|
|
2207
|
+
|
|
2208
|
+
## [v3.1.2] - 2023-02-28
|
|
2209
|
+
|
|
2210
|
+
### Fixed
|
|
2211
|
+
|
|
2212
|
+
- 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://...")
|
|
2213
|
+
|
|
2200
2214
|
## [v3.1.0] - 2021-10-7
|
|
2201
2215
|
|
|
2202
2216
|
### Added
|