A plugin from outside PopCraft

Popprint is the worked example. Its source does not live in this repository. It is a plugin you install from the marketplace, and the service it talks to is its own site. That is the shape a third-party integration takes: your code, our editor, payment on your domain.

What it does

From an open comic, Popprint offers two actions.

  • Print a copy uploads the print pages and opens a private checkout. The order is not listed for sale.
  • Sell this comic publishes a public page on the Popprint site. Anyone with the link can buy a printed copy. A later run updates the artwork on the same page.

Popprint prints through Mixam and takes payment with Stripe, including Apple Pay. Sellers connect a Stripe account and keep their share of a public sale. PopCraft does not process that payment.

What the marketplace listing has to say

The plugin id is popprint.comics. It asks for read, export and network. The description says that it uploads the file's print-page PDFs to Popprint. A network plugin that sends file contents without saying so does not pass review.

People install it from the marketplace (/marketplace/plugin/popprint.comics), not by being handed a zip.

The same shape, for your own service

  1. Keep the plugin in your repository: manifest.json, main.js, and ui.html if you show a panel.
  2. Ask only for the permissions you use. If you upload the file, say where it goes, in the description.
  3. Export with exportNode. PDF is 300 dpi, with bleed and no crop marks.
  4. The sandbox cannot open a tab. Call openExternal with an https URL (http is only allowed on localhost). Your server must allow cross-origin requests from an opaque origin.
  5. Publish from Manage plugins… → Publish from file…. The first version stays in review until it is approved. After that, anyone can install it.
  6. Take payment on your site. A hosted Checkout session is enough for Apple Pay once the domain is registered with your payment provider. If other people sell through you, connect their accounts there. PopCraft does not take a cut of that sale.

Store the id of the thing you published in popcraft.storage, so the next run updates it instead of creating a second one.