We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Twilio v4 library the Twilio client is of type any.
import { Twilio } from "twilio/lib" const twilio_client = new Twilio( <SID>, <AUTH> )
the type of twilio_client is any in version 4 whereas in version 3 it used to be the correct type i.e. TwilioClient.
The text was updated successfully, but these errors were encountered:
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
Sorry, something went wrong.
Hi everyone!
I started to face the same issue when I updated the twilio library from v3.x to v4.x:
twilio
import twilio from 'twilio'; const accountSid = process.env.TWILIO_ACCOUNT_SID; const authToken = process.env.TWILIO_AUTH_TOKEN; const client = twilio(accountSid, authToken, { accountSid: subaccountSid });
But the linter show me this rule error:
Unsafe assignment of an any value. eslint(@typescript-eslint/no-unsafe-assignment)
any
twilio-node version: v4.19.0 node version: v16.18.0
twilio-node
Adding the following to my tsconfig.json fixed the issue
"compilerOptions": { "esModuleInterop": true }
My somewhat less-than-elegant workaround was to do this:
import twilio from 'twilio'; const apiKey = process.env.TWILIO_API_KEY; const apiSecret = process.env.TWILIO_API_SECRET; const accountSid = process.env.TWILIO_ACCOUNT_SID; if (apiKey && apiSecret && accountSid { const client=new twilio.Twilio( apiKey, apiSecret, { accountSid } ) }
No branches or pull requests
Issue Summary
When using Twilio v4 library the Twilio client is of type any.
Steps to Reproduce
the type of twilio_client is any in version 4 whereas in version 3 it used to be the correct type i.e. TwilioClient.
Code Snippet
Technical details:
The text was updated successfully, but these errors were encountered: