Providers
A provider is used to send and receive messages between the wrapper and the app. This is required as apps are sandboxed in an iframe while the wrapper is running in the native context.
Import
Providers are usually being imported from @aragon/api
or @aragon/wrapper
.
ES6
ES5 (CommonJS)
MessagePortMessage
A provider communicates through the MessageChannel PostMessage API. It is suitable to use in background scripts since WebWorkers are natively compatible with the MessageChannel API.
Parameters
target
: The object (that implements the MessageChannel PostMessage API) to send messages to. (optional, defaultself
)
WindowMessage
A provider that communicates through the Window PostMessage API. It is suitable to use in front-ends connected through an iframe by passing window.parent.
Example
Parameters
target
: The object (that implements the Window PostMessage API) to send messages to.
Last updated