Install the Plugin SDK, understand the internote object, and learn the patterns every plugin uses
The Plugin SDK is the bridge between your plugin and the internote runtime. It wraps the postMessage protocol that the sandboxed iframe uses to communicate with the parent page and exposes a typed API your plugin calls directly.
Install the SDK as a dependency in your plugin project:
The package includes TypeScript declarations. No separate @types package is needed.
internote ObjectThe SDK exports a single internote object. Import it at the top of your plugin entry file:
internote is a singleton — it is pre-constructed and wired to window.addEventListener('message', ...) on import. You do not instantiate it yourself.
internote.onInitialize(handler) — fires once when the plugin loads with its initial attrs and dimensionsinternote.onAttrsUpdate(handler) — fires when parameter-driven attr values change at runtimeinternote.onResize(handler) — fires when the element is resized by the internote layoutinternote.onUnload(handler) — fires when the plugin element is removedinternote.ready() — signals the host that your plugin has rendered its first frameinternote.animation — synchronise with the cue and cut timelineinternote.storage — persist and retrieve plugin state across sessionsinternote.onPointer(handler) — receive pointer events forwarded from the host pageinternote.onKeyboard(handler) — receive keyboard events forwarded from the host pageImport the types you need alongside internote:
Every plugin follows this structure: register an onInitialize handler, set up your render, call ready(), and register an onUnload handler for cleanup.
Register all handlers at the top level of your entry file — not inside setTimeout, fetch callbacks, or dynamically. The SDK queues incoming messages and delivers them once each handler is registered, but handlers registered after the init message arrives may miss data.