Virtual Events

Shop, bet, and chat during a live match

Pick a fan and watch a football match with live shopping and betting on top. Chat, react with emoji, add featured products to your bag, and bet coins on what happens next. Built with the PubNub Chat SDK.

The Live Shopping Stream demo: a football match with the Go Live camera box, a featured product card, live commentary, an in-play bet, the chat, and emoji reactions
About this demo

Live commerce on top of a match stream

This demo shows a live shopping experience during a football match. When you press Start Demo, a Node.js simulator replays the match on a timeline. It publishes commentary, crowd chat, reactions, featured products, and bets, each on its own PubNub channel. It also publishes the playback position, so every viewer's video stays in sync and late joiners jump to the right moment. The web app is built with Next.js and the PubNub Chat SDK, which runs on the PubNub JavaScript SDK.

When you pick a fan, the app gets an Access Manager token for that user and loads their coins and shopping bag from App Context. The demo was built with Red5 Pro: the match itself is a recorded video, and the code includes hooks for a Red5 Pro WHIP/WHEP stream, which the hosted version doesn't use. The source code is open on GitHub, and the in-app tours explain how each part is built.

Features

What you can do

  • Chat with other viewers

    Send messages over the stream next to the simulated crowd. Every viewer gets them as they arrive through the Chat SDK.

  • See who is watching

    The viewer count in the top bar comes from Presence. It changes as people join and leave the stream.

  • React with emoji

    Tap an emoji under the stream. It is published to everyone watching and floats up on every screen.

  • Shop featured products

    Products appear on every screen at set moments in the match. Add them to your bag and change quantities. The bag is saved in your App Context user profile.

  • Bet coins on the match

    Answer in-play questions such as who gets the first corner, and pick your stake. Results arrive as messages, winnings are paid in coins, and your balance is saved in App Context.

  • Go live with your camera

    Share your camera for 60 seconds in a picture-in-picture box, and other viewers can watch it. The browsers connect over WebRTC, and PubNub carries the signaling messages.

Build it yourself

Make your own Live Shopping Stream

Clone the finished app, add your PubNub keys, and run the web app and the match simulator side by side.

GitHub

PubNubDevelopers/red5-live-shopping

The complete source. Add your keys to web/.env and backend/.env, run yarn install and yarn dev in web, then npm install and npm run generator in backend (Node.js 22 or later).

git clone https://github.com/PubNubDevelopers/red5-live-shopping.git
View on GitHub
Keep building

Build interactive real-time experiences with PubNub

Bring chat, live updates, and real-time interactions into your application without building the infrastructure from scratch.