<script src="https://media.twiliocdn.com/sdk/js/chat/releases/4.0.0/twilio-chat.js"></script>
This script is required npm install --save twilio-chat. just twillio alone is no enough
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I want to use twilio API in my vuejs2 app looking at demo https://github.com/TwilioDevEd/sdk-starter-node:
I try to follow it and read token backendpoint, which looks like “eyJ0eXAiO...” and I try next :
...
const Twilio = require('twilio')
console.log('$twilio::')
console.log(Twilio)
console.log('$twilio.Chat::')
console.log(Twilio.Chat)
const client = await Twilio.Chat.Client.create(token)
I got error :
TypeError: Cannot read property 'Client' of undefined
and in console I see invalid twilio object : https://prnt.sc/w41cc7
I suppose I imported invalid twilio object, but how correctly ? looks like in the sdk-starter-node-master was done in the same way and I do not see difference?
package.json :
"axios": "^0.19.0",
"core-js": "^3.3.2",
...
"twilio": "^3.54.0",
"vue": "^2.6.10",
...
Thanks!
Please or to participate in this conversation.