-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Labels
priority: mediumImportant but not urgent; Workaround availableImportant but not urgent; Workaround availabletype: questionquestion directed at the libraryquestion directed at the library
Description
Hi, I'm using twilio package version 5.8.0 from npm, with TypeScript and Express.js.
When I tried to use the express middleware, I see the following in the console:
twilio.webhook({
^
TypeError: twilio.webhook is not a function
Here is my code, from the typing it's absolutely fine:
import { Router } from "express";
import handler from "./handler.js";
import * as twilio from "twilio";
const router = Router();
router.post(
"/",
twilio.webhook({
authToken: process.env.TWILIO_AUTH_TOKEN,
}),
handler
);
export default router;
I got my code by referencing this page:
https://www.twilio.com/docs/usage/tutorials/how-to-secure-your-express-app-by-validating-incoming-twilio-requests
Is it outdated?
Metadata
Metadata
Assignees
Labels
priority: mediumImportant but not urgent; Workaround availableImportant but not urgent; Workaround availabletype: questionquestion directed at the libraryquestion directed at the library