@twilio/conversations 3.0.0-canary.5 → 3.0.0-canary2.100
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 +22 -18
- package/builds/browser.js +1360 -2410
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +74 -69
- package/builds/lib.js +1360 -2410
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +25229 -25615
- package/builds/twilio-conversations.min.js +1 -16
- package/dist/aggregated-delivery-receipt.js +1 -1
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/client.js +99 -70
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +30 -12
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/conversation.js +92 -23
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +21 -5
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +13 -19
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +6 -4
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +4 -2
- package/dist/data/users.js.map +1 -1
- package/dist/detailed-delivery-receipt.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/interfaces/attributes.js.map +1 -1
- package/dist/interfaces/notification-types.js.map +1 -1
- package/dist/logger.js +2 -4
- package/dist/logger.js.map +1 -1
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +24 -21
- package/dist/message.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/dist/participant.js +2 -2
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js.map +1 -1
- package/dist/rest-paginator.js.map +1 -1
- package/dist/services/network.js +38 -15
- package/dist/services/network.js.map +1 -1
- package/dist/services/typing-indicator.js +7 -5
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js.map +1 -1
- package/dist/user.js +2 -2
- package/dist/user.js.map +1 -1
- package/dist/util/deferred.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/package.json +27 -23
package/README.md
CHANGED
@@ -18,31 +18,35 @@ Using this method, you can `require` `twilio-conversations` and then use the
|
|
18
18
|
client:
|
19
19
|
```
|
20
20
|
const { Client } = require('@twilio/conversations');
|
21
|
+
|
21
22
|
const client = new Client(token);
|
22
|
-
|
23
|
-
//
|
24
|
-
client.on('
|
25
|
-
|
26
|
-
// Use the client
|
27
|
-
}
|
28
|
-
|
29
|
-
if (error) {
|
30
|
-
// Handle error
|
31
|
-
}
|
23
|
+
|
24
|
+
// Before you use the client, subscribe to the `'initialized'` event.
|
25
|
+
client.on('initialized', () => {
|
26
|
+
// Use the client.
|
32
27
|
}
|
28
|
+
|
29
|
+
// To catch client initialization errors, subscribe to the `'initFailed'` event.
|
30
|
+
client.on('initFailed', ({ error }) => {
|
31
|
+
// Handle the error.
|
32
|
+
});
|
33
33
|
```
|
34
34
|
|
35
35
|
The SDK could also be imported using the ES module syntax:
|
36
36
|
```
|
37
37
|
import { Client } from '@twilio/conversations';
|
38
|
+
|
38
39
|
const client = new Client(token);
|
39
|
-
|
40
|
-
//
|
41
|
-
client.on('
|
42
|
-
|
43
|
-
// Use the client
|
44
|
-
}
|
40
|
+
|
41
|
+
// Before you use the client, subscribe to the `'initialized'` event.
|
42
|
+
client.on('initialized', () => {
|
43
|
+
// Use the client.
|
45
44
|
}
|
45
|
+
|
46
|
+
// To catch client initialization errors, subscribe to the `'initFailed'` event.
|
47
|
+
client.on('initFailed', ({ error }) => {
|
48
|
+
// Handle the error.
|
49
|
+
});
|
46
50
|
```
|
47
51
|
|
48
52
|
### CDN
|
@@ -50,7 +54,7 @@ client.on('stateChanged', (state) => {
|
|
50
54
|
Releases of `twilio-conversations.js` are hosted on a CDN, and you can include these
|
51
55
|
directly in your web app using a `<script>` tag.
|
52
56
|
```html
|
53
|
-
<script src="https://media.twiliocdn.com/sdk/js/conversations/
|
57
|
+
<script src="https://media.twiliocdn.com/sdk/js/conversations/v2.2/twilio-conversations.min.js"></script>
|
54
58
|
```
|
55
59
|
Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client:
|
56
60
|
```
|
@@ -68,7 +72,7 @@ number. While less flexible it is significantly more secure, which is required b
|
|
68
72
|
To consume securely use the following script snippet format:
|
69
73
|
|
70
74
|
```html
|
71
|
-
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/
|
75
|
+
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.2.0/twilio-conversations.min.js"
|
72
76
|
integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
|
73
77
|
crossorigin="anonymous"></script>
|
74
78
|
```
|