-
-
Save geekvijay/9aa9809e5691bf57ea0253ce62ad0ba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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