You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2022. It is now read-only.
I got client object with Twilio credentials, but next I want to assign tokenAboutToExpire with code like :
const client = new Twilio(
process.env.VUE_APP_TWILIO_API_KEY,
process.env.VUE_APP_TWILIO_API_SECRET,
{
accountSid: process.env.VUE_APP_TWILIO_ACCOUNT_SID,
}
)
console.log('client::')
console.log(client)
console.log('client.chat::')
console.log(client.chat)
client.on("tokenAboutToExpire", async () => { // Error line
// client.chat.on("tokenAboutToExpire", async () => { // If to uncomment this line
const token = await this.fetchChatToken()
client.updateToken(token)
})
and got error:
Uncaught (in promise) TypeError: client.on is not a function
at _callee3$ (usersChat.vue?ec5f:264)
at tryCatch (runtime.js?96cf:63)
at Generator.invoke [as _invoke] (runtime.js?96cf:293)
and in the console I see that I have client and client.chat : https://prnt.sc/w4frzp
What is wrong?
Is it invalid client object?