Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit a4f459a

Browse files
authored
Update to use npm package (#18)
* Add npm package, update readme to include copying min.js file for simplicity, remove old instructions about downloading build artifact * Add specificity to .min.js copy instruction
1 parent ea31551 commit a4f459a

File tree

3 files changed

+1190
-91
lines changed

3 files changed

+1190
-91
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
This application should give you a ready-made starting point for writing your own voice apps with Twilio Voice JavaScript SDK 2.0 (Formerly known as Twilio Client).
1414

15-
16-
> **NOTE** The Twilio JS SDK library is included in this repo as [`twilio.min.js`](./public/twilio.min.js) using the build artifact from the [2.0.0 tag](https://github.com/twilio/twilio-voice.js/releases/tag/2.0.0). The 2.0.1 version is expected to be publicly available on npm before 7/11/2021. This project will be updated to use `npm install @twilio/twilio-voice` at that time.
17-
18-
1915
This application is built in Node.
2016

2117
Implementations in other languages:
@@ -78,24 +74,31 @@ Before we begin local development, we need to collect all the config values we n
7874
npm install
7975
```
8076

81-
4. Launch local development web server.
77+
4. Copy the `twilio.min.js` file from your `node_modules` to your `public` directory. Run the following from the root directory of your project:
78+
79+
```bash
80+
cp node_modules/@twilio/voice-sdk/dist/twilio.min.js public
81+
```
82+
**Note:** In order to keep this quickstart as simple as possible, this step is used to avoid any need for build tools like Webpack.
83+
84+
5. Launch local development web server.
8285

8386
```bash
8487
npm start
8588
```
8689

87-
5. Navigate to [http://localhost:3000](http://localhost:3000) in your browser.
90+
6. Navigate to [http://localhost:3000](http://localhost:3000) in your browser.
8891

89-
6. Expose your application to the wider internet using `ngrok`. This step is **crucial** for the app to work as expected.
92+
7. Expose your application to the wider internet using `ngrok`. This step is **crucial** for the app to work as expected.
9093

9194
```bash
9295
ngrok http 3000
9396
```
9497

95-
7. `ngrok` will assign a unique URL to your tunnel.
98+
8. `ngrok` will assign a unique URL to your tunnel.
9699
It might be something like `https://asdf456.ngrok.io`. You will need this to configure your TwiML app in the next step.
97100

98-
8. Configure your TwiML app
101+
9. Configure your TwiML app
99102

100103
- In the Twilio Console, navigate to [Programmable Voice > TwiML > TwiML Apps](https://www.twilio.com/console/voice/twiml/apps)
101104
- Select the TwiML App you created earlier

0 commit comments

Comments
 (0)