Skip to main content
Red5 Cloud and PubNub form a composable real-time stack: Red5 delivers sub-250ms video via WebRTC through the Experience Delivery Network, while PubNub handles sub-100ms chat messages, reactions, and presence signals. Because both systems operate in parallel on the same stream, your users see frame-synchronized chat and interactions rather than the noticeable drift common in loosely coupled architectures. Red5 Cloud provisions your PubNub API keys automatically when you create an account, so you can start integrating immediately without managing a separate PubNub account.

How keys are provisioned

When you create a Red5 Cloud account, the platform automatically generates a dedicated PubNub keyset for you. These keys are scoped to your account and pre-configured to work with the Red5 SDK sample code and TrueTime Meetings.

Retrieve your keys

1

Log in to the Red5 Cloud Management Console

Go to red5.net and sign in to your account.
2

Open Dev Resources

Click Dev Resources in the main dashboard navigation.
3

Copy your PubNub keys

Locate the PubNub Chat Integration section. Copy your Publish Key and Subscribe Key — you will need both in your application code.
Your PubNub keys are pre-configured for use with Red5 sample code. You do not need a separate PubNub account to start building.

Integration by platform

Red5’s SDKs handle audio/video via WebRTC, while PubNub manages messaging, presence, and signaling. Use your stream name as the PubNub channel name so that viewers watching a stream are automatically placed in the correct chat room.
The HTML5 integration uses the Red5 WHIPClient (or RTCSubscriber) for video alongside the PubNub JavaScript SDK for chat. Initialize both with your stream name and use it as the PubNub channel.
<!-- Include the PubNub JS SDK -->
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.7.4.5.min.js"></script>
import { WHIPClient } from '@red5pro/red5pro-webrtc-sdk';

// 1. Start the Red5 video publisher
const publisher = new WHIPClient();
await publisher.init({
  host: 'xxx.red5pro.net',
  app: 'live',
  streamName: 'myStream',
  mediaElementId: 'red5pro-publisher'
});
await publisher.publish();

// 2. Initialize PubNub with the same stream name as the channel
const pubnub = new PubNub({
  publishKey: 'YOUR_PUBNUB_PUBLISH_KEY',
  subscribeKey: 'YOUR_PUBNUB_SUBSCRIBE_KEY',
  userId: 'user-' + Date.now()
});

pubnub.subscribe({ channels: ['myStream'] });

pubnub.addListener({
  message: ({ message }) => {
    console.log('Chat message received:', message);
  }
});

// 3. Send a chat message
await pubnub.publish({
  channel: 'myStream',
  message: { text: 'Hello from the publisher!' }
});
Use the same streamName value for both the Red5 connection and the PubNub channel. This ensures that all participants watching a stream share a single chat room automatically.

TrueTime Meetings: zero-config PubNub

TrueTime Meetings is Red5’s flagship conferencing app and the fastest way to see the Red5 + PubNub stack in action. It comes pre-wired to your account’s PubNub keys — no glue code required.

Zero-config chat

TrueTime Meetings reads your PubNub keys directly from your Red5 Cloud account. Deploy the app and chat is immediately active.

Presence

PubNub’s presence feature automatically tracks who is online in each meeting room, powering the participant list.

Signaling

Raise-hand events and participant controls are delivered over PubNub, keeping the video path free of control traffic.
If you deploy TrueTime Meetings from the Red5 Cloud Management Console, PubNub is configured automatically. You do not need to set any PubNub keys manually.

Key benefits

CapabilityRed5 CloudPubNub
LatencySub-250ms video via XDNSub-100ms messages
ProtocolWebRTC / RTMPPublish/Subscribe
ScaleAuto-scaling edge nodesGlobal PubNub network
CredentialsManaged in Red5 Cloud ConsoleAuto-provisioned with Red5 account

Next steps

TrueTime Meetings

Deploy a full-featured video conferencing app with PubNub chat already wired in.

Stream Manager API

Use the REST API to manage streams, resolve server endpoints, and create transcoding provisions.