handsome-easter-5670
08/26/2025, 5:33 PMtall-airline-16756
08/26/2025, 5:33 PMtall-airline-16756
08/26/2025, 5:33 PMlivekit-client) because that SDK is mainly for using tokens to connect to LiveKit. Instead, token generation happens on the backend with the LiveKit Server SDK (livekit-server-sdk).
For example, here’s a simple way to create a token server using Node.js and Express:
app.post('/api/get-token', async (req, res) => {
const { identity, roomName } = req.body;
const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity });
token.addGrant({ room: roomName, roomJoin: true, canPublish: true, canSubscribe: true });
res.json({ token: await token.toJwt(), url: LIVEKIT_URL });
});
Also, LiveKit offers a handy Node.js token server template that you can check out for guidance.
If you want a hand setting up your token server or have any questions, just give me a shout—I’m here to help!
Sources: TEMPLATE.md | JavaScript quickstart (web) | LiveKit Docs | examples/rpc/api.ts | client/web/src/app/api/token/route.tshandsome-easter-5670
08/26/2025, 5:35 PMtall-airline-16756
08/26/2025, 5:45 PM