Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt

Use this file to discover all available pages before exploring further.


A Livepeer live event stream supports three features layered on top of basic RTMP ingest: simultaneous restreaming to third-party RTMP destinations (multistream), automatic recording to a VOD asset, and playback access control via JWT tokens or webhook verification.

Multistream Targets

Multistream simultaneously pushes a live stream to additional RTMP destinations (YouTube Live, Twitch, custom RTMP servers) alongside Livepeer transcoding. Create a multistream target:
import { Livepeer } from 'livepeer';
const client = new Livepeer({ apiKey: process.env.LIVEPEER_API_KEY });

const target = await client.multistream.createTarget({
  url: 'rtmp://a.rtmp.youtube.com/live2/<youtube-stream-key>',
  name: 'YouTube Live',
  disabled: false,
});
Attach the target to a stream at creation or via update:
const { stream } = await client.stream.create({
  name: 'my-event',
  profiles: [...],
  multistream: {
    targets: [
      { id: target.multistreamTarget.id, profile: '720p' },
    ],
  },
});
The profile field specifies which transcoding rendition to forward. Omitting it sends the original ingest quality.

Recording

Set record: true on stream creation to automatically archive the stream to a VOD asset:
const { stream } = await client.stream.create({
  name: 'recorded-event',
  profiles: [...],
  record: true,
  recordingSpec: {
    profiles: [
      { name: '720p', bitrate: 3000000, fps: 30, width: 1280, height: 720 },
    ],
  },
});
When the stream goes idle, Livepeer generates a VOD asset from the recording. The stream.recording.ready webhook fires when the asset is available. Retrieve the recording:
const recordings = await client.stream.getAll({ streamId: stream.id });

Playback Access Control

By default, streams are publicly playable. Restrict playback using a playback policy: JWT-based access control:
const signingKey = await client.accessControl.createSigningKey();

const { stream } = await client.stream.create({
  name: 'private-event',
  profiles: [...],
  playbackPolicy: {
    type: 'jwt',
    webhookContext: {},
  },
});
Livepeer validates a signed JWT in the accessKey query parameter of every playback request. Your application issues tokens signed with the signing key private key. Webhook-based access control:
const { stream } = await client.stream.create({
  name: 'webhook-gated',
  profiles: [...],
  playbackPolicy: {
    type: 'webhook',
    webhookId: '<your-webhook-id>',
    webhookContext: { eventId: 'event-2026' },
  },
});
For each playback request, Livepeer calls your webhook URL with the request context. Your application returns 200 to allow or 4xx to deny.

Updating and Terminating Streams

Update a stream’s configuration while it is active:
await client.stream.update(stream.id, {
  record: true,
  multistream: { targets: [...] },
});
Terminate an active stream (force-disconnects the RTMP publisher):
await client.stream.terminate(stream.id);
Retrieve stream status:
const { stream: current } = await client.stream.get(stream.id);
console.log(current.isActive);    // true while RTMP is connected
console.log(current.lastSeen);    // epoch ms of last frame received

Ingest

RTMP ingest configuration and stream creation.

VOD

Working with recorded assets after a stream ends.

Player

@livepeer/react Player for HLS and low-latency WebRTC playback.

Video Overview

Access paths and workload types for Livepeer video.
Last modified on May 19, 2026