I am new to reactjs - and looking to gain access to the Twilio chat feature.
I've done an npm install on this module. https://www.npmjs.com/package/twilio-chat
The documentation says:
Client instantiation looks as follows:
Twilio.Chat.Client.create(token).then(client => {
// Use client
});
or, using async/await syntax:
let client = await Twilio.Chat.Client.create(token);
// Use client
/// Old code I am reconfiguring javascript that was sitting on a codeignitor base. This function worked.
"chatClient = new Twilio.Chat.Client(data.token)"
/// New code
import Chat from 'twilio-chat'
-- so I've tried something like this first
chatClient = new Chat.Client(data.token)
then something like
chatClient = Chat.Client(data.token)
When I do these console logs..I get the following
console.log('Twilio>', Chat)
it shows
Twilio> function Client(token, options) {
(0, _classCallCheck3.default)(this, Client);
var _this = (0, _possibleConstructorReturn3.default)(this, (Client.__proto__ || (0, _getPrototypeOf2.default)(Cl…
if I delve into this
console.log('Twilio-->Client', Chat.Client)
it shows
Twilio-->Client undefined