So I am following these instructions for my Component View Javascript (with PHP backend) application:
Developers → Docs → Meeting SDK → Web → Meetings
And I continue to get: JOIN_MEETING_FAILED - Not support start meeting via tokens.
The is my current script to init and join the meeting:
function startZoomMeeting(zakToken) {
console.log(zakToken);
// Initialize Zoom client
const client = ZoomMtgEmbedded.createClient();
let meetingSDKElement = document.getElementById('meetingSDKElement');
client.init({
zoomAppRoot: meetingSDKElement,
language: 'en-US'
});
// Generate the signature using jsrsasign
function generateSignature(sdkKey, sdkSecret, meetingNumber, role) {
const iat = Math.round(new Date().getTime() / 1000) - 30
const exp = iat + 60 * 60 * 2
const oHeader = { alg: 'HS256', typ: 'JWT' }
const oPayload = {
sdkKey: sdkKey,
appKey: sdkKey,
mn: meetingNumber,
role: role,
iat: iat,
exp: exp,
tokenExp: exp
};
const sHeader = JSON.stringify(oHeader);
const sPayload = JSON.stringify(oPayload);
const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret);
return signature;
}
const sdkKey = '{{env('ZOOM_SDK_KEY')}}';
const sdkSecret = '{{env('ZOOM_SDK_SECRET')}}';
const meetingNumber = '1';
const role = 1; // 1 = host, 0 = participant
const userName = 'my name';
const userEmail = 'myauthorizedemail';
const password = '';
// Generate signature
const signature = generateSignature(sdkKey, sdkSecret, meetingNumber, role);
// Join Zoom meeting using the generated signature
client.join({
sdkKey: sdkKey,
signature: signature,
meetingNumber: meetingNumber,
userName: userName,
userEmail: userEmail,
zak: zakToken, // Optional: only needed for the host
success: (success) => {
console.log(success)
},
error: (error) => {
console.log(error)
},
});
}
I have made sure that when requesting the zak token, to have type=zak at the end of the token get request.
I am unsure where to turn. I would be incredibly grateful for any help.