Format Your New Topic as Follows:
Meeting SDK Type and Version
“@zoom/meetingsdk”: “^3.13.2”
Description
My setup is a General App with the Meeting SDK Embed enabled.
I have an OAuth flow for a user who then gets a Zak token.
Backend Code:
Code to generate signature:
const expirationSeconds = 60 * 60; // 1 hour
const iat = Math.floor(Date.now() / 1000);
const exp = expirationSeconds ? iat + expirationSeconds : iat + 60 * 60 * 2;
const oHeader = { alg: 'HS256', typ: 'JWT' };
const oPayload = {
appKey: this.clientId,
sdkKey: this.clientId,
mn: meetingNumber,
role,
iat,
exp,
tokenExp: exp,
// video_webrtc_mode: videoWebRtcMode
};
const sHeader = JSON.stringify(oHeader);
const sPayload = JSON.stringify(oPayload);
const sdkJWT = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, this.clientSecret);
Code to generate zak:
const apiToken = await this.getApiAccessToken(); // This gets OAuth token
const url = new URL(`${this.apiUrl}/users/me/token`);
url.searchParams.append('type', 'zak');
const response = await fetch(url.toString(), {
method: 'GET',
headers: {
Authorization: `Bearer ${apiToken}`,
},
});
if (!response.ok) {
console.error('Failed to fetch Zoom ZAK token:', response.statusText, await response.text());
throw new Error(`Failed to get ZAK token: ${response.statusText}`);
}
const data = await response.json();
console.log('Zoom ZAK token:', data);
return data.token;
Frontend code
export function ZoomComp() {
const meetingNumber = '123456789';
const client = useMemo(() => ZoomMtgEmbedded.createClient(), []);
const meetingSDKElement = document.getElementById('meetingSDKElement');
if (!meetingSDKElement) throw Error('meetingSDKElement not found');
const { data: signatureData } = useEndpoint('getZoomSignature', { meetingNumber, role: 1 });
client.init({
debug: true,
zoomAppRoot: meetingSDKElement,
language: 'en-US',
});
const joinMeeting = useCallback(() => {
if (!signatureData) return;
const params = {
sdkKey: signatureData.sdkKey,
signature: signatureData.signature,
meetingNumber,
userName: 'Sam',
zak: signatureData.zoomAccessKey,
};
client.join(params);
}, [client, signatureData]);
return (
<div>
<h1>Zoom Component</h1>
<button onClick={joinMeeting}>Join Meeting</button>
</div>
);
}
Error?
{type: 'JOIN_MEETING_FAILED', reason: 'Not support start meeting via tokens', errorCode: 200}
Things I’ve Tried
- Yes the zak url appends
type=zak
to the query param - Yes Meeting SDK Embed is enabled
What else should I be looking for?