Skip to main content

How Compose Works

Compose employs a hybrid architecture under which business logic and secrets live within your infra, while the rendering of interfaces for your apps is handled by Compose.

When you run your script, the Compose SDK open a secure, background websocket connection to our servers.

Afterwards, method calls such as page.add() and page.toast() are serialized into JSON, and sent to the browser for rendering. Similarly, user interactions in the browser (e.g. a button click) are serialized and sent back to the SDK for you to handle.

The SDK never connects directly to the browser. Instead, all communication is encrypted and proxied through Compose's servers, ensuring security by allowing us to authenticate both the browser and SDK.