Skip to content

Plugins ​

Plugins add commands, side panels and custom blocks to Tessera, and can read and write your pages and databases when you allow it. They are small ES modules written against a typed SDK, @tessera/plugin-api, and every one of them runs in a sandbox: a plugin can only do what its permissions allow, and a broken plugin can't take the app down with it.

Settings → Plugins with five plugins installedSettings → Plugins with five plugins installed

For plugin authors ​

  • Getting started: a working plugin with a command, a panel and a custom block in five minutes, with live reload and tests.
  • API reference: everything api can do, generated from the SDK's TSDoc.
  • Permissions and security: what each permission allows, how the sandbox works, and its limits.
  • Publishing: package your plugin and list it in a registry.
ts
import { definePlugin } from '@tessera/plugin-api';

export default definePlugin({
  activate(api) {
    api.commands.register({
      id: 'say-hello',
      title: 'Say hello',
      run: () => api.ui.notify('Hello from my first plugin 👋'),
    });
  },
});

What a plugin can do ​

CapabilityAPIPermission
Commands in the palette, with shortcutsapi.commands.registerui:commands
Side panels next to the pageapi.ui.addPanelui:panels
Custom blocks, inserted from the slash menu, with data saved in the pageapi.ui.addBlockui:blocks
Read pages as markdown or as a document tree, and follow changesapi.pagespages:read
Create pages, rename them, replace their contentapi.pagespages:write
Query databases by property and option namesapi.databasesdatabases:read
Add and update database rowsapi.databasesdatabases:write
Private key-value storage on this deviceapi.storagestorage
fetch to a declared domainthe browser's fetch and WebSocketnetwork:api.example.com
Settings with a generated formapi.settingsnone
The app's theme (colors, fonts, light or dark)api.themenone
Notificationsapi.ui.notifynone

Examples ​

The repository ships five complete plugins in examples/plugins, each with a README and tests:

  • Word count 🔢: a side panel that follows the open page as you type.
  • Daily notes 📅: commands with shortcuts, pages created from a template, work at startup.
  • Pomodoro 🍅: a timer panel whose state lives in storage, shared with the worker.
  • Random page 🎲: the smallest useful plugin, one command.
  • Mermaid diagrams 🧜: a custom block with a live editor, drawn in the app's theme.
A Mermaid diagram blockA Mermaid diagram block

Installing plugins ​

Everything happens in Settings → Plugins:

  • Browse lists the plugins of a registry (the example registry by default; the source can be changed next to the search box). Installing from it checks the download against the registry: its checksum when one is listed, and that the plugin asks for nothing the registry doesn't show.
  • Install plugin installs from a .zip file, a plugin folder (where the browser supports picking folders), or a URL to a .zip or a manifest.json.
  • Load a dev plugin connects to a plugin author's dev server and reloads the plugin each time its code changes.

Before anything is installed, Tessera shows what the plugin will be able to do, in plain words. Each plugin's page in Settings has its permissions (each can be revoked at any time), its settings, a console with its logs and errors, and Uninstall, which also deletes its stored data.

The permission prompt shown before installingThe permission prompt shown before installing

Released under the MIT License.