PopCraft Plugins

Plugins extend PopCraft with your own tools. A plugin can read and edit the open file, show its own panel, export layers, and put interactive widgets on the canvas that everyone in a file can use.

Plugins are small web bundles (a JSON manifest, a JavaScript file and optional HTML). They run in a secure sandbox, work offline, and can be shared privately with your team or published to the PopCraft plugin marketplace.

Finding plugins

Browse the marketplace from the editor · 0:07
Description

The editor with a landing page open. The Marketplace button on the right rail opens the marketplace: plugins, templates, libraries and themes, with categories and a search. Templates and then Motion narrow it to animated templates, and clicking one (Synthwave tunnel visualizer) opens its listing, with its preview and description. Installing needs an account.

The Marketplace button on the editor's right rail opens the marketplace: plugins, themes, templates, libraries, brushes and shaders, each with its own categories. Click a listing to see its preview and description, and install it (installing needs an account).

You can also browse it without opening the editor, on the website's Marketplace page. It lists the same items in the same order as the editor, with the same tabs, and templates and libraries that have a preview first. Animated templates loop their preview while it's on screen (or show a still if your system asks for reduced motion). The rest of this section is about building your own.

Guides

GuideWhat it covers
Getting startedBuild, package, install and run your first plugin in ten minutes
ManifestEvery manifest.json field, commands and permissions
Plugin APIThe popcraft global: nodes, selection, styles, variables, export, storage, events
Plugin UIShowing a panel and messaging between it and your plugin
WidgetsInteractive canvas objects with shared state
PublishingThe marketplace, review, versioning and installing for your workspace
ImportersContribute File → Import / Home drop formats
Agent toolsGive the AI agent tools that run in your plugin
Third-party integrationShip a plugin from your own repo, list it, and take payment on your site
@popcraft/pluginsThe SDK: types for editor autocomplete

Examples

Four worked example plugins — commands, a UI panel, a canvas widget and a theme pack — live in the open-source getpopcraft/plugins repository, alongside the SDK itself.

How plugins work

┌──────────────── PopCraft editor ────────────────┐
│                                                  │
│   main.js  ── sandboxed, invisible ──┐           │
│      ▲                               │ popcraft  │
│      │ postMessage                   ▼ API calls │
│   ui.html ── sandboxed panel      document,      │
│              (optional)           selection, …   │
└──────────────────────────────────────────────────┘
  • Main script (main.js) runs when someone picks one of your plugin's commands. It has no DOM access to the editor; it talks to PopCraft through the asynchronous popcraft API.
  • UI (ui.html, optional) is shown in a floating panel when you call popcraft.showUI(). It exchanges messages with the main script.
  • Widgets are canvas objects your plugin renders from state. They're saved in the file, so collaborators see them even without the plugin.

Security model

  • Every plugin runs in an isolated, sandboxed frame with its own opaque origin. It can't read the editor page, cookies, other plugins or your account.
  • Plugins can only do what their manifest's permissions allow (read, write, export, network), and the user approves those the first time the plugin runs. Calls outside the approved set fail with an error.
  • Network access is blocked unless the plugin asks for network.
  • Plugins installed from the marketplace are reviewed before they're listed, and again whenever a new version asks for more permissions.

Limits at a glance

LimitValue
Package size (marketplace)5 MB
Plugin id2–64 characters: letters, digits, ., _, - (must start with a letter or digit)
Plugin panel size160–900 × 120–900 px
Export scale0.1×–8×
Widget tree400 elements, 16 levels deep
Widget state64 KB of JSON