I am facing an issue while testing the Zoom Meeting SDK for the web. Specifically, I am encountering an “Invalid sdkKey” error, and I am reaching out to seek your assistance in resolving this matter.
Here is a snippet of the code I am using to generate the SDK JWT on the server side:
const iat = Math.round(new Date().getTime() / 1000) - 30
const exp = iat + 60 * 60 * 2
const oHeader = { alg: 'HS256', typ: 'JWT' }
let key="xxx"
let secret="xxx"
const oPayload = {
sdkKey: key,
appKey: key,
mn: req.body?.meetingNumber,
role: req.body?.role,
iat: iat,
exp: exp,
tokenExp: exp
}
const sHeader = JSON.stringify(oHeader)
const sPayload = JSON.stringify(oPayload)
const sdkJWT = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, secret)
And on the client side, I am using the following code:
ZoomMtg.init({
leaveUrl: leaveUrl,
isSupportAV: true,
success: (success) => {
ZoomMtg.join({
sdkKey: sdkKey,
signature: signature, // Pass in your Meeting SDK JWT
meetingNumber: meetingNumber,
passWord: passWord,
userName: "Test",
success: (success) => {
console.log(success)
},
error: (error) => {
console.log(error)
}
})
},
error: (error) => {
console.log(error)
}
})
I have double-checked the sdkKey and secret, but the error persists. Any insights or guidance on how to resolve this issue would be greatly appreciated.
Thank you for your time and assistance.