Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

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

This page covers SDK-specific communication — the JavaScript methods and event listeners exposed by pixelStreaming and emitUIInteraction.
Other ways to talk to Unreal exist:Each path has its own API. Use whichever matches the way you embed the stream.

Sending data to UE

UI interaction (custom JSON)

Send arbitrary JSON to UE. Primary method for custom web → UE messaging.
appStream.stream.emitUIInteraction({
  type: 'action',
  value: 'jump'
});

appStream.stream.emitUIInteraction({
  command: 'setColor',
  color: '#ff0000',
  intensity: 0.8
});
Handle these messages in UE via the Pixel Streaming Input Component’s OnInputEvent delegate or FPixelStreamingInputHandler in C++.

Console commands

Run UE console commands remotely:
pixelStreaming.emitConsoleCommand('stat fps');
pixelStreaming.emitConsoleCommand('r.SetRes 1920x1080f');
pixelStreaming.emitConsoleCommand('stat unit');
Console commands run with the UE app’s permissions. Only commands that are enabled in your UE build will work — restrict which commands can be executed remotely in your build.

Text input

Send text to UE’s currently focused text field. Mostly used in response to UE’s on-screen keyboard request:
pixelStreaming.streamMessageController
  .toStreamerHandlers.get('TextboxEntry')?.(['Hello from the web!']);

Receiving data from UE

Listen for custom messages sent from UE → web:
pixelStreaming.addResponseEventListener('handle_responses', (response) => {
  const data = JSON.parse(response);

  switch (data.type) {
    case 'gameState':
      updateGameUI(data.state);
      break;
    case 'notification':
      showNotification(data.message);
      break;
  }
});
In UE, send messages with the Send Pixel Streaming Response Blueprint node or UPixelStreamingDelegates::SendPixelStreamingResponse in C++.

On-screen keyboard

When UE requests text input via showOnScreenKeyboard, the SDK handles it automatically:
1

UE sends showOnScreenKeyboard

With the current text content and cursor position.
2

SDK shows the input modal

The built-in EditTextModal opens.
3

User confirms input

Types and submits.
4

SDK sends text back to UE

Via the TextboxEntry handler.
No code needed on your side — the SDK manages the modal and round-trip automatically.

Round-trip example

// Web → UE: Request the score
appStream.stream.emitUIInteraction({
  type: 'request',
  action: 'getScore'
});

// UE → Web: Receive it
pixelStreaming.addResponseEventListener('handle_responses', (response) => {
  const data = JSON.parse(response);
  if (data.type === 'scoreUpdate') {
    document.getElementById('score').textContent = data.score;
  }
});

Next

pixelStreaming API

Full reference for emitConsoleCommand, addResponseEventListener, etc.

Unreal-side blueprints

The matching UE-side setup for receiving and sending JSON.