API Reference
Connection Details

Connection Details

Generates a participant token for viewers to connect and watch a stream.

Endpoint

GET /api/connection-details

Request Headers

HeaderRequiredDescription
x-api-keyYesYour API key

Query Parameters

ParameterTypeRequiredDescription
roomNamestringYesName of the room to join
participantNamestringYesDisplay name for the viewer
metadatastringNoJSON string of custom metadata

Example Request

curl -X GET "https://live-api.block8910.com/api/connection-details?roomName=my-room&participantName=John" \
  -H "x-api-key: YOUR_API_KEY"

With Metadata

curl -X GET "https://live-api.block8910.com/api/connection-details?roomName=my-room&participantName=John&metadata=%7B%22role%22%3A%22viewer%22%7D" \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "serverUrl": "wss://live.block8910.com",
  "roomName": "my-room",
  "participantToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "participantName": "John"
}

Response Fields

FieldDescription
serverUrlWebSocket URL for connecting to the server
roomNameThe room name to join
participantTokenJWT token for authentication (valid for 5 minutes)
participantNameDisplay name of the participant

Using the Token

Use the token with a LiveKit client SDK to connect:

import { Room } from 'livekit-client';
 
const room = new Room();
await room.connect(serverUrl, participantToken);