You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,9 @@ $ cp .env.example .env
51
51
| CALL_ANNOUCEMENT_LANGUAGE | The language to speak announcements in. | "en" or any of the [supported languages](https://www.twilio.com/docs/voice/twiml/say#attributes-language). |
52
52
| OUT_OF_SESSION_MESSAGE_FOR_CALL | A message to play if someone calls the number pool without an active session. | "Your session is no longer active. Goodbye." |
53
53
| CONNECTING_CALL_ANNOUCEMENT | A message to play when a caller is being connected to the other party. | "We're connecting you to your agent now." |
54
-
| DOMAIN | The domain where the application will be hosted. | "mysite.com" or "https://your-domain.ngrok.io"|
55
-
54
+
| DOMAIN | The domain where the application will be hosted. | "mysite.com" or "your-domain.ngrok.io" (no https://) |
Once you have your environment variables set, you can start the app with this command:
58
59
@@ -85,6 +86,10 @@ Two webhooks can be configured in the Twilio Console:
85
86
- Paste your webhook (`https://[your-domain]/conversations-post-event`) into the Post-Event URL input box.
86
87
- Click "save" at the bottom of the page.
87
88
89
+
# Authentication & Webhook Validation
90
+
The app requires basic auth on request to the `/sessions` endpoint. This prevents an unauthorized person from creating sessions. To use basic auth, make sure `DOMAIN` (e.g. mysite.com, no http://), `AUTH_USERNAME`, and `AUTH_PASSWORD` are all set in your .env file, and restart the app.
91
+
92
+
Webhooks are automatically validated using the Twilio Webhook signature. This prevents an unauthorized request to start a phone call without your permission. For webhook validation to work, your app needs `DOMAIN` to be set along with `TWILIO_AUTH_TOKEN` in the .env file.
88
93
89
94
# Usage
90
95
You can create a new masked-number session between multiple users by making a post request to the `/sessions` endpoint:
@@ -146,4 +151,4 @@ To conduct a load test on the app, run:
146
151
```bash
147
152
$ yarn loadtest
148
153
```
149
-
This will generate 300 conversations in 20ms intervals against the app.
154
+
This will generate 300 conversations in 20ms intervals against the app.
0 commit comments