Trying to require Twilio npm module with twilio = require('https://bundle.run/twilio@3.48.2') which works, but when I try to pass it my Twilio credentials `{
const client = new twilio("my-account0sid, Secret(“TWILIO_AUTH_TOKEN”));
const messages = client.messages.list({limit: 20})
.then(messages => messages.forEach(m => console.log(m.sid)));
return messages;
} I geto.URL is not a constructor`
and haven’t found a way to import this to analyze previous text messages.
By the way, there is already an issue for this problem on Github:
Please note that the maintainer advises against the use of the twilio package on the client side:
At a high-level, this repo should not be used in a client-side (React) app. Communicating with Twilio APIs requires auth which would be exposed to the end-user. Blog about this and how to re-architect: How to send an SMS from React with Twilio