Create a Vonage Video API session and generate participant tokens

domain: tokbox.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the Vonage Video API server SDK for your language (e.g., @vonage/video for Node.js) and initialize it with your API key and API secret from the Vonage Dashboard.
  2. Call opentok.createSession() (or the equivalent method in your SDK) with options such as mediaMode: 'routed' for server-mediated SFU routing or 'relayed' for peer-to-peer; a routed session is required for multi-party calls and server-side recording.
  3. Store the returned sessionId persistently (e.g., in a database); a session represents a persistent communication context and its ID is used by all participants joining the same conversation.
  4. Generate a token for each participant by calling opentok.generateToken(sessionId, { role: 'publisher', expireTime: <unix timestamp>, data: '<metadata string>' }); role can be 'subscriber', 'publisher', or 'moderator'.
  5. Return the sessionId and token to your client application; the client initializes the OT (OpenTok) SDK with OT.initSession(apiKey, sessionId) and then calls session.connect(token, callback).
  6. For security, generate a new token for each participant connection attempt rather than caching tokens; tokens expire after the duration set at creation (default 24 hours after generation).

Known gotchas

Related routes

Generate a Zoom Video SDK session authentication JWT to join a video session
developers.zoom.us · 5 steps · unrated
Migrate an OpenTok project to the Vonage Video API using the dashboard transition flow
developer.vonage.com · 6 steps · unrated
Create a call server-side with the Stream (getstream.io) Video API and issue a client auth JWT
getstream.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans