@twilio/conversations 2.1.0-rc.8 → 3.0.0-canary.5
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 +7 -3
- package/builds/browser.js +2350 -1627
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +512 -304
- package/builds/lib.js +2350 -1627
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +3448 -3403
- package/builds/twilio-conversations.min.js +2 -2
- package/dist/client.js +402 -281
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +2 -2
- package/dist/configuration.js.map +1 -1
- package/dist/conversation.js +408 -373
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +9 -10
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +46 -26
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +19 -10
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +2 -2
- package/dist/data/users.js.map +1 -1
- package/dist/media.js +36 -25
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js +24 -18
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +46 -19
- package/dist/message.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js.map +1 -1
- package/dist/services/typing-indicator.js +1 -1
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js +13 -3
- package/dist/unsent-message.js.map +1 -1
- package/package.json +12 -10
- package/CHANGELOG.md +0 -404
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +0 -3184
- package/docs/classes/Client.html +0 -4073
- package/docs/classes/Conversation.html +0 -4302
- package/docs/classes/DetailedDeliveryReceipt.html +0 -3163
- package/docs/classes/Media.html +0 -3193
- package/docs/classes/Message.html +0 -3677
- package/docs/classes/MessageBuilder.html +0 -3254
- package/docs/classes/Participant.html +0 -3444
- package/docs/classes/PushNotification.html +0 -3130
- package/docs/classes/RestPaginator.html +0 -3160
- package/docs/classes/UnsentMessage.html +0 -3042
- package/docs/classes/User.html +0 -3349
- package/docs/index.html +0 -3512
- package/docs/interfaces/ClientOptions.html +0 -3034
- package/docs/interfaces/ConversationBindings.html +0 -3001
- package/docs/interfaces/ConversationEmailBinding.html +0 -3001
- package/docs/interfaces/ConversationLimits.html +0 -3098
- package/docs/interfaces/ConversationState.html +0 -3050
- package/docs/interfaces/CreateConversationOptions.html +0 -3066
- package/docs/interfaces/LastMessage.html +0 -3050
- package/docs/interfaces/Paginator.html +0 -3141
- package/docs/interfaces/ParticipantBindings.html +0 -3001
- package/docs/interfaces/ParticipantEmailBinding.html +0 -3001
- package/docs/interfaces/PushNotificationData.html +0 -3066
- package/docs/interfaces/SendEmailOptions.html +0 -3034
- package/docs/interfaces/SendMediaOptions.html +0 -3068
- package/docs/modules.html +0 -3513
package/README.md
CHANGED
@@ -21,10 +21,14 @@ const { Client } = require('@twilio/conversations');
|
|
21
21
|
const client = new Client(token);
|
22
22
|
// Before you use the client, subscribe to the `'stateChanged'` event and wait
|
23
23
|
// for the `'initialized'` state to be reported.
|
24
|
-
client.on('stateChanged', (state) => {
|
24
|
+
client.on('stateChanged', ({ state, error }) => {
|
25
25
|
if (state === 'initialized') {
|
26
26
|
// Use the client
|
27
27
|
}
|
28
|
+
|
29
|
+
if (error) {
|
30
|
+
// Handle error
|
31
|
+
}
|
28
32
|
}
|
29
33
|
```
|
30
34
|
|
@@ -46,7 +50,7 @@ client.on('stateChanged', (state) => {
|
|
46
50
|
Releases of `twilio-conversations.js` are hosted on a CDN, and you can include these
|
47
51
|
directly in your web app using a `<script>` tag.
|
48
52
|
```html
|
49
|
-
<script src="https://media.twiliocdn.com/sdk/js/conversations/
|
53
|
+
<script src="https://media.twiliocdn.com/sdk/js/conversations/v3.0.0/twilio-conversations.min.js"></script>
|
50
54
|
```
|
51
55
|
Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client:
|
52
56
|
```
|
@@ -64,7 +68,7 @@ number. While less flexible it is significantly more secure, which is required b
|
|
64
68
|
To consume securely use the following script snippet format:
|
65
69
|
|
66
70
|
```html
|
67
|
-
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/
|
71
|
+
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/3.0.0/twilio-conversations.min.js"
|
68
72
|
integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
|
69
73
|
crossorigin="anonymous"></script>
|
70
74
|
```
|