Connection Details
Generates a participant token for viewers to connect and watch a stream.
Endpoint
GET /api/connection-detailsRequest Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
roomName | string | Yes | Name of the room to join |
participantName | string | Yes | Display name for the viewer |
metadata | string | No | JSON 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
| Field | Description |
|---|---|
serverUrl | WebSocket URL for connecting to the server |
roomName | The room name to join |
participantToken | JWT token for authentication (valid for 5 minutes) |
participantName | Display 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);