Public beta. These pages describe version 2.0.0-beta.2 of
@streampixel/web-sdk. Names and behaviour can still change before the stable 2.0.0 release. See the changelog.stream object: it tells you what the stream is doing, and it lets you talk to your app.
Choose your path
I am new here
Beginner. See your app in your own page in five minutes: one HTML file, nothing to install.
I am building a page
Intermediate. npm, the ready-made screens, React, talking to your app.
I am going to production
Advanced. States and events, access, errors, shared sessions, recipes.
I want to know exactly what happens
Expert. How the engine loads and updates, recovery timings, diagnostics.
I have a page on the v1 SDK
Upgrading. Keep your code with the compatibility package, or move to the v2 API.
I am looking something up
Reference. Every option, method, event and error.
Do you need the Web SDK?
Streampixel has three ways to put a stream in front of a viewer. Use the simplest one that does what you need.Use an iframe when…
Use an iframe when…
You want the stream on your own site with almost no code, and Streampixel’s screens are fine. Your page can still send commands and receive messages through the frame.
Use the Web SDK when…
Use the Web SDK when…
- You want your own screens and controls: your own loading screen, your own buttons, your own layout.
- Your page and your Unreal app talk to each other a lot, and you want plain method calls and events for it.
- Your code must know exactly what the stream is doing: queued, reconnecting, why it ended.
- You build with a framework such as React and want the stream to be a component of your app.
What you need
Two things to check if they apply to you:
- Your site sends a Content-Security-Policy header. Allow the SDK’s hosts: see Content-Security-Policy.
- Your project has an allowed-domains list. The address of your page must be on it: see The allowed-domains list.
What is in the box
Without a build step, one
<script> tag gives you the SDK with the same API: see Installation.
What the SDK does for you
What the SDK does for you
- Access. It follows the project’s access setting in the dashboard: public, password, or single sign-on. See Access.
- One state.
stream.statealways says what the stream is doing, and thestateevent fires on every change. - Recovery. It reconnects by itself when the connection drops, and starts one fresh session by itself when no video arrives. See Reliability.
- Plain-language endings. When a session ends, your code gets a code, a kind and a sentence you can show the viewer.
- Epic’s names work too. If you know Epic’s Pixel Streaming library,
emitUIInteraction(),emitConsoleCommand()andaddResponseEventListener()are on the stream object. See Talk to your Unreal app.
How the SDK stays up to date
How the SDK stays up to date
The package you install is a small loader. The engine, the code that runs the stream, is downloaded from Streampixel’s servers when your page starts a stream. Fixes reach your site without a new install or deploy.The engine is verified before it runs, and there is no copy of it in the package: if it cannot be loaded,
create() rejects with EngineLoadError. See How it works and The engine and its updates.What the SDK reports to Streampixel
What the SDK reports to Streampixel
The SDK reports the session’s lifecycle and connection quality to Streampixel’s own telemetry service. These reports are what the session pages of your dashboard show. There are no third-party trackers, no analytics SDKs and no cookies in the package. Passwords, tickets and the messages between your page and your app are never sent. See Diagnostics.
Next steps
Your first stream
One HTML file, five minutes.
How it works
Your page, the SDK, the platform and the GPU server, step by step.
Installation
npm or a script tag, TypeScript, frameworks.
FAQ
Short answers to common questions.