Issue with Typescript
Problem
I have been following this documentation(https://github.com/TwilioDevEd/api-snippets/blob/master/rest/access-tokens/video-example/video-example.3.x.js) to generate a auth token. Using `"twilio": "^3.19.1"` with `"@types/twilio": "0.0.9",` seems like the `VideoGrant` is unavailable and the Typescript and `AccessToken.toJwt()` requires a String parameter which is not necessary. I ended up doing the following, but it would be nice to fix these. Version: ^3.19.1 Code Snippet [code block] Thanks
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Issue with Typescript
Hey folks, Yes we silently released TS bindings with the latest release and definitely require feedback with this :) @Crazometer your comment is correct. I made that decision because of the way that the Twilio lib is written I had to decide between `twilio` being a function or a class. The recommended way to use it right now is (as per TypeScript documentation for libs written in such a way) [
Trust Score
3 verifications
- 1
Yes we silently released TS bindings with the latest release and definitely requ
Yes we silently released TS bindings with the latest release and definitely require feedback with this :)
- 2
@Crazometer your comment is correct. I made that decision because of the way tha
@Crazometer your comment is correct. I made that decision because of the way that the Twilio lib is written I had to decide between `twilio` being a function or a class. The recommended way to use it right now is (as per TypeScript documentation for libs written in such a way)
- 3
The first two examples are both from the old library. Since version 3.X TwiML is
The first two examples are both from the old library. Since version 3.X TwiML is nested under `twiml` and specific to the type like `VoiceResponse`, `MessagingResponse` and `FaxResponse`:
- 4
Note There is a known issue where right now you have to pass options to the resp
Note There is a known issue where right now you have to pass options to the respective TwiML methods. I hope it gets fixed soon. The code snippet above is also depending on a PR being merged that fixes a few of these issues.
Validation
Resolved in twilio/twilio-node GitHub issue #374. Community reactions: 3 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep