Skip to content

Commit bfbe3b0

Browse files
authored
[VBLOCKS-4113] chore: clarify handling of env vars (#30)
* chore: clarify handling of env vars * feat: add guide for bash zsh * chore: add note for source
1 parent e6202c8 commit bfbe3b0

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ Twilio Voice JavaScript Reference Components leverages [Web Components](https://
1010
git clone https://github.com/twilio/twilio-voice-js-reference-components.git
1111
```
1212

13-
2. Create a `.env` file and initialize the following environment variables under the `twilio-voice-js-reference-components` folder. Go through the [quickstarts](https://www.twilio.com/docs/voice/sdks/javascript/get-started) for more information about these variables.
13+
2. Install the dependencies.
14+
15+
```bash
16+
npm install
17+
```
18+
19+
3. Create a `.env` file and initialize the following environment variables under the `twilio-voice-js-reference-components` folder. Load the `.env` variables into `process.env` based on your specific platform. Go through the [quickstarts](https://www.twilio.com/docs/voice/sdks/javascript/get-started) for more information about these variables.
1420

1521
```bash
1622
# Port number to run the server on
@@ -43,10 +49,17 @@ CALLBACK_BASE_URL=https://foo.ngrok.dev
4349
DEFAULT_IDENTITY=alice
4450
```
4551

46-
3. Install the dependencies.
52+
- For example, if you're using `bash/zsh` format your `.env` like so:
4753

4854
```bash
49-
npm install
55+
export ACCOUNT_SID=ACxxxxxxxxxxxxxx
56+
```
57+
58+
- Then, under the `twilio-voice-js-reference-components` folder run:
59+
- Note: running `source .env` will cause environment variables to persist in your shell session, and will be available to all processes afterwards.
60+
61+
```bash
62+
source.env && npm run start
5063
```
5164

5265
## Run the project locally

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "twilio-voice-js-reference-components",
33
"version": "1.0.0",
44
"scripts": {
5-
"start": "source .env && node src/server.js"
5+
"start": "node src/server.js"
66
},
77
"type": "module",
88
"engines": {

0 commit comments

Comments
 (0)