@twilio/conversations 2.3.1-rc.0 → 2.4.0-rc.1

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 CHANGED
@@ -1,21 +1,21 @@
1
+ # Twilio Conversations client library
1
2
 
2
- Twilio Conversations client library
3
- =============
4
3
  Twilio Conversations: Create meaningful connections with customers across various communication channels.
5
4
  Visit our official site for more detalis: [https://www.twilio.com/conversations](https://www.twilio.com/conversations)
6
5
 
6
+ ## Instantiating and using
7
7
 
8
- Instantiating and using
9
- ------------
10
8
  To use the library you need [to generate a token](https://www.twilio.com/docs/conversations/create-tokens) and pass it to the Conversations Client constructor.
11
9
 
12
10
  ### NPM
11
+
13
12
  ```
14
13
  npm install --save @twilio/conversations
15
14
  ```
16
15
 
17
- Using this method, you can `require` `twilio-conversations` and then use the
16
+ Using this method, you can `require` `twilio-conversations` and then use the
18
17
  client:
18
+
19
19
  ```
20
20
  const { Client } = require('@twilio/conversations');
21
21
 
@@ -33,6 +33,7 @@ client.on('initFailed', ({ error }) => {
33
33
  ```
34
34
 
35
35
  The SDK could also be imported using the ES module syntax:
36
+
36
37
  ```
37
38
  import { Client } from '@twilio/conversations';
38
39
 
@@ -53,10 +54,13 @@ client.on('initFailed', ({ error }) => {
53
54
 
54
55
  Releases of `twilio-conversations.js` are hosted on a CDN, and you can include these
55
56
  directly in your web app using a `<script>` tag.
57
+
56
58
  ```html
57
- <script src="https://media.twiliocdn.com/sdk/js/conversations/v2.3/twilio-conversations.min.js"></script>
59
+ <script src="https://media.twiliocdn.com/sdk/js/conversations/v2.4/twilio-conversations.min.js"></script>
58
60
  ```
61
+
59
62
  Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client:
63
+
60
64
  ```
61
65
  const client = new Twilio.Conversations.Client(token);
62
66
  ```
@@ -72,13 +76,15 @@ number. While less flexible it is significantly more secure, which is required b
72
76
  To consume securely use the following script snippet format:
73
77
 
74
78
  ```html
75
- <script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.3.0/twilio-conversations.min.js"
76
- integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
77
- crossorigin="anonymous"></script>
79
+ <script
80
+ src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.4.0/twilio-conversations.min.js"
81
+ integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
82
+ crossorigin="anonymous"
83
+ ></script>
78
84
  ```
79
85
 
80
- Find the hash of each release published on the [Changelog](#Changelog) page.
86
+ Find the hash of each release published on the [Changelog](#changelog) page.
81
87
 
82
- ### Changelog
88
+ ### Changelog
83
89
 
84
90
  See this [link](https://www.twilio.com/docs/conversations/javascript/changelog).