PlayCanvas Editor API and Realtime Sync
Use this skill when developing editor extensions via the Editor API, setting up WebSocket connections, or working with ShareDB/OT synchronization.
Version Guard
- Upstream Editor API matches the
playcanvas/editorv2.30.4implementation. - Realtime sync protocol runs over
@teamwork/websocket-json-streamandsharedb. - Operational Transformation uses
ot-text.
Required Output
Before modifying realtime sync behaviors or API endpoints:
- state ShareDB collection being accessed (
scenes,assets,settings); - describe the OT operation payload format;
- detail WebSocket handshake and authentication headers.
Workflow
- Realtime collaboration uses ShareDB documents for entity and asset properties.
- The frontend client sends JSON-encoded operations (ops) using OT.
- Programmatic manipulation of entities must use the Editor API (
editor.call(...)pattern). - Synchronize snapshots with the persistence adapter asynchronously.
Blocking Rules
- Do not assume full multi-user collaboration is enabled in the current Universo slice (persistence is single-user snapshot-only).
- Do not bypass ShareDB permission gates.
- Do not send uncompressed large textures or binary meshes over the WebSocket control channel.
- Do not let WebSocket connections leak on page/iframe reloads.