11
loading...
This website collects cookies to deliver better user experience
npm start,
you should load the template application by going to http://localhost:3000.App.js
and index.js
. In index.js
, remove the following line: import './index.css';
In App.js, be sure to remove the line import './App.css';
index.js
to load bootstrap. Simply add this line to your existing import statements.App.js
file. Our layout will have two parts: an email address form and a video call. App
component. You’ll want to insert these lines inside the App
definition before the return statement.npm start
, the Vercel CLI will start a development server that is available by going to http://localhost:3000../src
../api
as a serverless function. For our project, we want to create a new file called join.js
. This will create a new API endpoint at /api/join
. We’ll use this endpoint to determine if the user can join the meeting and generate the required JWT.isAllowed()
. This function consults a comma delineated list of email addresses to determine if the user can join the meeting. To make it easy to update, we’re storing the list of email addresses in an environment variable.generateJWT()
function. This does the bulk of the work in our serverless function. The generateJWT(0
will create the payload of our JWT, decode our public key, and finally sign the JWT.generateJWT()
, we’re calling out to yet another helper function to generate avatars for our users automatically. The generateAvatar()
function generates a Gravatar URL from the provided email address to populate avatars automatically.join.js
should look something like this:.env
file at the root of your project. Inside the .env
file create the following variables. You’ll be able to access them from inside your application by using the process.ENV.{Variable Name}
variables. ALLOW_LIST
with a comma delineated list of email addresses that you want to allow access to the meeting. For example:JAAS_ROOM_NAME
that fits your use case. For example:JAAS_APP_ID
environment variables.JAAS_PRIVATE_KEY
environment variable. To do this, run the following command:onSubmit
and send a request to our serverless function. initJaas()
. When our request to the serverless function is successful, the front end will call initJaas()
to start the call.