Installation
Mount the component in an iframe and grant the Surge embed origin access to the browser’s microphone:Query parameters
For new integrations, use
caller_id by itself. Set phone_number_id only when a verified Caller ID should use the call settings from a nondefault Surge Phone Number. When caller_id is a Surge Phone Number ID, phone_number_id must be omitted or set to the same ID.
Control the phone from your application
The component works as a standalone dialer, but the parent window can also control it withpostMessage. Every command must include target: "surge-phone".
For example, initiate a call with an E.164-formatted phone number:
Events
The Phone component emitspostMessage events for call and registration state changes.
Listen only for messages from the Surge embed origin: