Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Show auth token in webhook validation example #918

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const twilio = require("twilio");
const bodyParser = require("body-parser");
const MessagingResponse = require("twilio").twiml.MessagingResponse;

const authToken = process.env.TWILIO_AUTH_TOKEN;

const express = require("express");
const app = express();
const port = 3000;
Expand All @@ -18,7 +20,7 @@ app.get("/", (req, res) => {
res.send("Hello World!");
});

app.post("/message", twilio.webhook(), (req, res) => {
app.post("/message", twilio.webhook(authToken), (req, res) => {
// Twilio Messaging URL - receives incoming messages from Twilio
const response = new MessagingResponse();

Expand Down