Optional
connectedAttached window. Used for connecting to any window or iframe
.
import {Provider} from 'magic-transport'
const id = 'UNIQ_ID'
const childOrigin = '*'
const sharedObject = {
hello: {
from: {
provider: function () {
return 'hello from provider'
}
}
}
}
const iframe = document.createElement('iframe')
iframe.src = 'https://site.app/embed'
document.body.appendChild(iframe)
const transport = new Provider({
id,
childOrigin,
connectedWindow: iframe.contentWindow,
...sharedObject
});
Optional
expectedOrigin of the attached window.
Unique transport identifier. Must be the same for Provider and Consumer that communicate with each other.
Generated using TypeDoc
Base transport options.