FG
๐Ÿ”Œ APIs & SDKsTwilio

Issue with Typescript

Freshover 7 years ago
Mar 14, 20260 views
Confidence Score75%
75%

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

Canonical Fix
High Confidence Fix
74% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: Issue with Typescript

Low Risk

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) [

74

Trust Score

3 verifications

100% success
  1. 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. 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. 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. 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

Worked: 3
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

twiliosmsapi