I am trying to do a video app using JS but not using node. From my understanding the first thing that i need to do is to create a JWT token.
Based on the following documentation (https://media.twiliocdn.com/sdk/js/video/releases/2.7.2/docs/) if i use the CDN file, I initialize my JS by doing
const Video = Twilio.Video;
instead of
const Video = require('twilio-video');
However, to obtain the JWT token it seems that I need to load another CDN file? (it seems there is also a Twilio helper JS perhaps (https://www.twilio.com/docs/voice/client/javascript/device#method-reference)) as the examples of twilio are using to get the token loads a different library, but I cant find this JS file anywhere
My question is, can I generate a jwt token using the CDN file? in their documentation or I need to load a different file too?
<script src="//media.twiliocdn.com/sdk/js/video/releases/2.7.2/twilio-video.min.js"></script>
and how can I initialize the const AccessToken in plain js instead of (node version)
const AccessToken = require('twilio').jwt.AccessToken;
@Manza, as you have asked in the comments I am sharing the sample code of what I did.
Step 1: sent a post request using ajax with the Name and Meeting PIN as an input from user.
Step 2: Generating Token based on the meeting Pin using REST API in Asp.Net MVC 4.7
Step 3: On the frontend side on ajax success I save the token in localstorage and redirect to a new page where I included this JS SDK to do all the work from client side
Step 4: To create a new connection with using the token I used following code
I did try to include as much as I could, let me know if it helps.