Providers
Import
Providers are usually being imported from @aragon/api
or @aragon/wrapper
.
ES6
import { providers } from '@aragon/api'
import { providers } from '@aragon/wrapper'
ES5 (CommonJS)
const providers = require('@aragon/api').providers
const providers = require('@aragon/wrapper').providers
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
const provider = new WindowMessage(window.parent)
Parameters
target
: The object (that implements the Window PostMessage API) to send messages to.
Last updated
Was this helpful?