Skip to content

Generate a signature to Start and Join Sessions with the Zoom Web Video SDK.

License

Notifications You must be signed in to change notification settings

marcelklopper/videosdk-sample-signature-node.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zoom Video SDK Sample Signature Node.js

Use of this sample app is subject to our Terms of Use.

This is a Node.js / Express server that generates a Video SDK signature via an http request from your frontend for use in the Zoom Video SDK.

If you would like to skip these steps and just deploy the finished code to Heroku, click the Deploy to Heroku button. (You will still need to configure a few simple things, so skip to Deployment.)

Deploy

Installation

In terminal, run the following command to clone the repo:

$ git clone https://github.com/zoom/videosdk-sample-signature-node.js.git

Setup

  1. In terminal, cd into the cloned repo:

    $ cd videosdk-sample-signature-node.js

  2. Then install the dependencies:

    $ npm install

  3. Create an environment file to store your Video SDK Apps's Key and Secret:

    $ touch .env

  4. Add the following code to the .env file, and insert your Video SDK Apps's Key and Secret found on the App Credentials page in the Zoom App Marketplace.:

    ZOOM_VIDEO_SDK_KEY=VIDEO_SDK_KEY_HERE
    ZOOM_VIDEO_SDK_SECRET=VIDEO_SDK_SECRET_HERE
    
  5. Save and close .env.

  6. Start the server:

    $ npm run start

Usage

Make a POST request to http://localhost:4000 (or your deployed url) with the following request body:

Body Description
sessionName Session Name of your choice.
sessionPasscode Session Passcode of your choice.

Example Request

POST http://localhost:4000

Request Body:

{
  "sessionName": "Cool Cars",
  "sessionPasscode": "Ilovecars!"
}

If successful, the response body will be a JSON representation of your signature:

{
  "signature": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJhcHBfa2V5IjoiQVBJS0VZSEVSRSIsImlhdCI6MTYyMDI0NzE2OSwiZXhwIjoxNjIwMjU0MzY5LCJ0cGMiOiJDb29sIENhcnMiLCJwd2QiOiJJbG92ZWNhcnMhIn0="
}

In the Video SDK, pass in the signature to the client.join() object:

// make http request to your server to get the signature

client.join(
  topic: sessionName,
  signature: signature,
  userName: userName,
  password: sessionPasscode,
).then((data) => {
  console.log(data);
}).catch((error) => {
  console.log(error);
});

Deployment

If you used the Deploy to Heroku button, enter a name for your app on the page the button took you to (or leave it blank to have a name generated for you), and fill in the values for these,

  • ZOOM_VIDEO_SDK_KEY (Your Zoom Video SDK Key, found on your Zoom Video SDK App's Credentials page)
  • ZOOM_VIDEO_SDK_SECRET (Your Zoom Video SDK Secret, found on your Zoom Video SDK App's Credentials page)

Then click "Deploy App".

Now you can generate and use your signature via the deployed url Heroku provides.

If you cloned this repo, use the Heroku CLI to deploy your server.

  1. In terminal, create a Heroku app:

    $ heroku create

  2. Add your files:

    $ git add -A

  3. Commit your files:

    $ git commit -m "deploying to heroku"

  4. Deploy your server by pushing your files to Heroku:

    $ git push origin heroku

  5. Navigate to your app on the Heroku dashboard, click settings, and add your Video SDK App's Credentials in the Config Variables,

    • ZOOM_VIDEO_SDK_KEY (Your Zoom Video SDK Key, found on your Zoom Video SDK App's Credentials page)
    • ZOOM_VIDEO_SDK_SECRET (Your Zoom Video SDK Secret, found on your Zoom Video SDK App's Credentials page)

Now you can generate and use your signature via the deployed url Heroku provides.

Need help?

If you're looking for help, try Developer Support or our Developer Forum. Priority support is also available with Premier Developer Support plans.

About

Generate a signature to Start and Join Sessions with the Zoom Web Video SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%