Skip to content
playactor
Esc
↑↓navigate↵open⌘Jpreview
On this page

External plugins

A plugin built outside the app, installed into its plugins folder and loaded at startup.

An external plugin is the same definePlugin code as a built-in, built into one ESM file beside a plugin.json. You add it in Settings › Plugins › Add plugin; the app loads it at startup, after the built-ins. Adult, Internet Archive, Social, Sports, Clip.Cafe, ListenBrainz, Spotify, Tubi and Twitch ship this way, from the methodacting/playactor-plugins repo, through Playactor’s plugin feed.

Twitch’s Home puts who you follow first, then categories, popular live streams and clips; open a category for its live streams, clips and past broadcasts.

Make, build and pack

The plugins repo sits beside the Playactor checkout and links its SDK (@playactor/plugin, @playactor/ui) from there, so a plugin builds against the SDK the app ships. Its tooling is the Playactor CLI, playactor plugin …, linked from the same checkout; the repo’s pnpm scripts call it.

pnpm new quotes         # plugins/quotes: a manifest and one page
pnpm dev quotes         # rebuild on every change, link dist/quotes into the running app, swap it in after each build
pnpm build adult        # dist/adult/index.js (its styles included) and dist/adult/plugin.json
pnpm pack-plugin adult  # dist/adult.playactor-plugin

dev links the folder rather than copying it, so a rebuild is never held back for Review.

A .playactor-plugin file is a zip of exactly plugin.json and the entry it names, at its root. The app refuses one with any other entry, a nested or absolute path, a .., or more than 16 MiB.

The build bundles message catalogs into the entry. When a catalog translates the plugin’s name, the build also writes it to localizedNames in plugin.json so the install dialog can show that name before the entry runs.

{
  "id": "adult",
  "name": "Adult",
  "version": "0.1.0",
  "requires": "0.1.40",
  "api": 8,
  "entry": "index.js",
  "collections": { "videos": { "version": 1 } },
  "permissions": [{ "kind": "web", "host": "www.example.com" }]
}

permissions is permissionsOf(manifest) from the linked checkout’s SDK, which the dialog lists before any of the plugin’s code runs. At load, the app derives them again from the entry’s manifest and holds back a plugin whose two lists differ. A build from before permissions was written shows Not listed on the dialog.

requires is the minimum Playactor version the plugin needs. By default, the build reads the linked checkout’s app version. An older app refuses to add it and holds it back at launch.

A plugin adopting an unreleased additive SDK feature can declare "playactor": { "requires": "0.2.23" } in its package.json. The build uses that minimum host version in plugin.json, the release feed, and the release notes. Publish only after a compatible Playactor release ships; the release command still checks the released SDK.

Publish to the feed

pnpm release archive minor

Bumps plugins/archive/package.json, builds and packs, signs the file with the app’s updater key (~/.tauri/playactor.key), appends a line to releases.json, commits, tags archive-v0.2.0, pushes, and uploads the GitHub release. It refuses while the Playactor checkout’s SDK (packages/plugin, packages/ui, the shared-module list) differs from its last release tag: release Playactor first.

The updater worker serves the feed from releases.json: the newest release of each plugin the asking app can run.

GET https://clipt-updater.methodactor.workers.dev/plugins?app=0.1.41
[{ "id": "archive", "name": "Internet Archive", "version": "0.2.0", "signature": "…", "url": "…/plugins/download/archive-v0.2.0/archive.playactor-plugin" }]

Add a plugin

Add plugin › What happens Updates
A Playactor plugin (listed under Playactor plugins) Downloaded, its signature checked against the key compiled into the app, then added after a dialog listing its permissions; adding it again skips the dialog unless it asks for more than you approved By itself: at launch and hourly, a newer release installs and swaps in, with a toast naming it. One that asks for more permissions than you approved is held back until you Review it
From file… (or drop the file on the window) A dialog shows its name, version, permissions, collections and SHA-256; Add copies it into the plugins folder and pins that hash and those permissions Add the newer file: the dialog shows the version change and marks the new permissions
From folder… Linked: read in place on every launch, never copied or pinned. For one you’re building Rebuild, then Reload on its row

Adding, updating, removing and Reload change only that plugin in the open window: nothing reloads. A plugin whose page is open swaps under it and the page reopens; a removed one’s page leaves to the library. Its rows stay on disk.

  • ~/Library/Application Support/actor.play.desktop/
    • preferences.json plugins.installed: each plugin’s source (feed, file or folder), version, SHA-256 and the permissions you approved
    • plugins/
      • adult/ a copied plugin
        • plugin.json
        • index.js

A dev build reads the installed app’s plugins folder and preferences.

From the command line

playactor (@playactor/cli) drives the running app through its control socket, api.sock in the app’s data folder (on Windows, a named pipe only your user can open). It does what Add plugin does, with the same dialog:

(cd plugins/quotes && playactor plugin i18n --check)       # check typed translations and catalogs
playactor plugin install ./dist/quotes.playactor-plugin  # the app shows its dialog; the command waits for your answer
playactor plugin install ./dist/quotes                   # a built folder links at once
playactor plugin list                                    # every plugin, its source and status (--json for JSON)
playactor plugin remove quotes
playactor plugin reload                                  # read linked folders again, swap in what changed
playactor app status                                     # which app answered, its version, what it loaded
playactor commands                                       # every command, its params, and whether it can run now
playactor run clip.last --param seconds=30               # run one by id, as playactor://run/clip.last?seconds=30 does
playactor open /library                                  # bring the app to the front on a page

--app release or --app dev picks the build; without it the command uses the one running, the installed app when both are. On macOS and Windows a build that isn’t running is started and waited for (on Windows, the installed release; start a dev build yourself). Install, remove and reload answer once the open window has the change; reload answers with what’s loaded.

playactor mcp serves the same calls as MCP tools over stdio (app_status, app_open, commands_list, commands_run, plugins_list, plugins_install, plugins_remove, plugins_reload), for an agent to drive the app. Three more read the library’s lists, each { items: [{ id, title, subtitle }] }, at most limit rows (26 unless asked):

Tool Lists An id plays with
lists_continueWatching Movies, next episodes and web videos started and not finished, the last played first play.media
lists_recentDownloads Movies and episodes whose download finished, the newest first play.media
lists_recentClips Clips, the newest first clip.play
{ "mcpServers": { "playactor": { "command": "playactor", "args": ["mcp"] } } }

Held back

A copied plugin’s SHA-256 (of plugin.json’s bytes, then the entry’s) is checked at every launch, a feed plugin’s too. One that doesn’t load shows in Settings › Plugins with why:

Shown Why Fix
Changed since you approved it Its files aren’t the ones you added (something wrote over its folder in plugins/) Review: the dialog again; approving pins the new hash
Not approved A folder in plugins/ you never added Review, or Remove
Folder missing Its folder in plugins/ is gone Remove, or add it again
Can’t be read A linked folder moved, a broken plugin.json, or plugin.json’s permissions aren’t its manifest’s Remove, or link it again
Needs a newer Playactor Its requires is newer than this app Update Playactor
Asks for more than you approved A feed release whose permissions grew (from its plugin.json, or its manifest for a build that lists none) Review: the dialog with the new lines marked; approving records them

Remove forgets the plugin and deletes its folder in plugins/; a linked folder is never touched. The plugin’s rows stay in the workspace, so adding it again brings them back.

Shared modules

The plugin’s imports of what the app owns stay bare, and the app’s import map resolves them to its own copy:

Shared Why one copy
react, react/jsx-runtime, react-dom Hooks and context break across two Reacts
@tanstack/db, @tanstack/react-db, @tanstack/react-query The plugin reads the app’s collections and query cache
zod Schemas cross into the app’s collections
sonner One toaster
@playactor/plugin, @playactor/ui and every subpath The SDK and its host components (@playactor/plugin/ui), and the components’ Radix contexts

Everything else is bundled into index.js: lucide-react icons, @tauri-apps/plugin-opener, a site parser. A bundled Tauri plugin’s calls go through the app’s IPC, under the app’s own permissions.

The build reads the shared list from the Playactor checkout, so it can’t drift, and fails if a bare import isn’t one the app serves. It always builds for production, whatever NODE_ENV the shell has: a development build would import react/jsx-dev-runtime, which the app doesn’t serve.

Styles

The app’s stylesheet holds only the Tailwind classes its own code uses, so the build compiles the plugin’s: it scans the plugin’s folder, compiles what it finds against the app’s theme (apps/desktop/src/App.css, imported for reference: its tokens, variants and custom utilities, none of its rules), and appends the CSS to index.js as export const styles. The CSS travels inside the entry, so the pin, the pack and the feed cover it. The build’s line reports its size.

The app adds each plugin’s sheet to its own utilities layer, after its rules, less every class the app or a plugin before it (by id) already styles. A plugin’s classes style its own elements and never restyle the app’s. A plugin built before this has no styles, and any class the app doesn’t use does nothing. Rebuild it to fix that.

A change to the app’s theme counts as an SDK change: release Playactor before releasing the plugins built against it.

SDK version

api is the PLUGIN_API the plugin was built against (from @playactor/plugin, now 8). It moves when the SDK breaks; rebuild the plugin then.

What the app refuses

Add plugin refuses a plugin built for another api, one that requires a newer app, one with a built-in’s id, one already added the other way (file or folder), and one whose collection slug a built-in collection uses, before anything is copied. At launch, a refused plugin is logged and skipped; the app carries on.

Refused Log line
api isn’t the app’s PLUGIN_API Plugin skipped: API mismatch
A built-in has its id Plugin skipped: a built-in has its id
requires is newer than the app Plugin held back: needs a newer Playactor
Its id isn’t the one it was added under Plugin failed to load
Its default export isn’t a definePlugin result from the app’s own SDK (it bundled a second copy) Plugin failed to load
collections disagree with the manifest’s Plugin failed to load
permissions disagree with the manifest’s Plugin held back: plugin.json's permissions are not the manifest's
Asks for more than you approved Plugin held back: asks for more than you approved
A collection slug a built-in collection already uses Plugin failed to load

A loaded one logs Plugin loaded with its id, version and source.

Collections

An external plugin’s collections are built when it loads, with the same names, stored ids and versions a built-in’s would have. A plugin moved out of the app keeps its rows: Adult’s videos are still adult-videos, version 1.

Was this page helpful?