Call Methods
Call api.send(type, payload) to invoke methods on the iframe. Optional promise-based responses when the embed replies.
Subscribe to Events
Use api.subscribe(event, callback) to listen for events from the iframe. Unsubscribe when needed.
postMessage Based
All communication uses the browser postMessage API. No cross-origin issues when the iframe is on a different domain.