Skip to content

Instantly share code, notes, and snippets.

@geekvijay
Created October 4, 2020 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geekvijay/9aa9809e5691bf57ea0253ce62ad0ba6 to your computer and use it in GitHub Desktop.
Save geekvijay/9aa9809e5691bf57ea0253ce62ad0ba6 to your computer and use it in GitHub Desktop.
const jwt = require("jsonwebtoken");
const ZOOM_SDK_KEY = "";
const ZOOM_SDK_SECRET = "";
const HOUR = 60 * 60;
const iat = Math.floor(Date.now() / 1000) - 60; // ms -> s
const exp = iat + 24 * HOUR;
const token = jwt.sign(
{
appKey: ZOOM_SDK_KEY,
iat: iat,
exp: exp,
tokenExp: exp,
},
ZOOM_SDK_SECRET,
{
header: {
alg: "HS256",
typ: "JWT",
},
}
);
console.log(token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment