pages functions package.json

I have a cloudflare pages application that is connected to gitlab and deploys when I push. In this repo is a
./functions
directory that contains a
_middleware.js
file that proxies all http requests to a node.js api if the pathname starts with
/api
.

I would like to use the twilio npm package like it does in this example
https://github.com/Ryandev/cloudflare-worker-twilio-sms

Where should I put this dependency? In the top-level
package.json
file at the root of the project or should I be putting in
functions/package.json
GitHub
Deploy SMS/Voice controller using cloudflare workers - GitHub - Ryandev/cloudflare-worker-twilio-sms: Deploy SMS/Voice controller using cloudflare workers
Was this page helpful?