Optionaloptions: {Plugin configuration options
Optionalhooks?: string[]Array of parent callback names that this plugin accepts and can invoke
Optionalmethods?: MethodsMap of method names to async functions the parent can call
Optionalvalidator?: (args: { data?: unknown; settings?: unknown }) => voidOptional function to validate received data and settings from parent
The plugin's window object (defaults to window)
The parent window object (defaults to window.parent)
Promise resolving to plugin interface containing:
data: Initial data sent by parentsettings: Configuration settings sent by parenthooks: Functions to invoke parent callbacksterminate: Function to cleanup and close communication
Registers a plugin with the parent window using postMessage RPC communication.
Call this function from within your plugin iframe to establish two-way communication with the parent window. This is the plugin-side counterpart to initFullscreenPlugin and initInlinePlugin.
Plugin Registration Flow
Basic Usage
Complete Example: Simple Note Editor Plugin
Error Handling
The library automatically adds an "error" hook if not present. Use it to report errors: