> ISPO SDK documentation. [HTML](https://ispo.ai/docs/functions/core.connectToHost.html) · [Documentation index](https://ispo.ai/docs/llms.txt)

# Function connectToHost

*   <a id="connecttohost"></a>
    
    ```typescript
    connectToHost(): ConnectionHandle
    ```
    
    Types: [ConnectionHandle](../interfaces/core.ConnectionHandle.md)
    
    Subscribe to host messages. Currently scoped to theme delivery and host focus requests; Phase 5 extends the same channel with permission-checked RPC.
    
    Source check: we only accept messages whose `source === window.parent`. That's stronger than an origin allowlist here because the host's origin differs across dev/prod ([http://localhost](http://localhost) vs file://) — the iframe always has exactly one parent in the browser process model.
    
    #### Returns [ConnectionHandle](../interfaces/core.ConnectionHandle.md)
