PureWeb uses the same internal components provided by Unreal’s pixel streaming plugin to support message passing. Much of the UE4 integration work as described in Epic’s documentation is still relevant, only the client portion has changed: https://docs.unrealengine.com/en-US/Platforms/PixelStreaming/CustomPlayer/index.html

Communicating from UE4 to PureWeb Client API

You can emit valid JSON data from UE4 to your PureWeb through the Pixel Streaming API:

Client side, messages are provided through a Reactive API:

1. Retrieve access to the Message Subject through the useStreamer Hook:

const [streamerStatus, emitter, videoStream, audioStream, messageSubject] = useStreamer(signallingConnection, streamerOptions);

2. messageSubject implements IObservable and can be subscribed to. It emits whenevers a new message is received from UE4.

3. Query message contents and perform actions.

4. Dispose of your subscription during any clean-up operations.

Communicating from PureWeb Client API to UE4

1. Retrieve access to the InputEmitter through the useStreamer Hook:

const [streamerStatus, emitter, videoStream, audioStream, messageSubject] = useStreamer(signallingConnection, streamerOptions);

2. Call EmitUIInteraction with a valid JavaScript object.

3. Monitor the PixelStreamingInputComponent through a Blueprint

This API is especially useful in moving functionality better suited to the client. For example, launching new URLs, filling out forms, retrieving user credentials, etc.