Skip to content

Getting started ​

A Tavora module is a web page that runs in a sandboxed panel inside Tavora Desktop, next to a game or any other workspace. It talks to the host through @tavora/sdk, and it ships as a folder with a tavora.module.json manifest and its built files.

Preview

@tavora/sdk speaks bridge protocol v1. Until Tavora's first public release it can still change in ways that break modules; the changelog marks each such change and says which Tavora a version needs.

Make a project ​

There are three ways to start. Pick the one that suits you; they all end up in the same place.

With the starter ​

sh
pnpm create @tavora/module
sh
npm create @tavora/module
sh
yarn create @tavora/module
sh
bun create @tavora/module
sh
vp create @tavora/module

It asks where the project goes (the empty folder you are in, or a new folder in it), the module's name, its id (publisher.module-name), the game it is for and a template: vanilla TypeScript, Vue or React. The project builds with Vite and depends on @tavora/sdk and @tavora/pack. Its page starts with bootstrapModule (see Talk to the host), its vite.config.ts is one moduleConfig() call (see Build the module), and its manifest already sets minTavora to the Tavora that SDK needs.

From an example ​

The same small module is built three ways in Tavora's repository: Vue, vanilla TypeScript and React. The panel types example shows a module with several panels (see Panel types).

The examples ship with Tavora too: under Examples in Settings > Developer > Project folders, Make a copy turns one into a project of your own, with its own id and the SDK from npm, in a project folder or a folder you pick.

In your own project ​

Add the SDK, and @tavora/pack for the build:

sh
pnpm add @tavora/sdk
pnpm add -D @tavora/pack
sh
npm install @tavora/sdk
npm install -D @tavora/pack
sh
yarn add @tavora/sdk
yarn add -D @tavora/pack
sh
bun add @tavora/sdk
bun add -d @tavora/pack
sh
vp add @tavora/sdk
vp add -D @tavora/pack

Then follow Build the module, and add a dev script such as vite build --watch.

Run it ​

In the project folder, install the packages and start dev. It builds, then builds again on every change, so leave it running:

sh
pnpm install
pnpm dev
sh
npm install
npm run dev
sh
yarn
yarn dev
sh
bun install
bun run dev
sh
vp install
vp run dev

With Vite+, use vp run dev, not vp dev: vp dev starts a dev server instead of building the module.

In Tavora, open Settings > Developer > Project folders, choose Add folder… and pick the project folder, or the folder you keep all your module projects in: Tavora loads every project directly inside it, and finds new ones by itself. The module appears in Add module, and its panels reload by themselves every time dev rebuilds.

Talk to the host ​

Start the page with bootstrapModule: it connects, applies Tavora's theme as CSS variables and keeps following it, and tracks the language. It works in any framework, and a failed connection gives status: "failed" instead of throwing.

ts
import { bootstrapModule, languageOf } from "@tavora/sdk/bootstrap";

const boot = await bootstrapModule();
const tavora = boot.sdk;
if (!tavora) return showError(boot.error); // outside Tavora, or another protocol version
let language = languageOf(boot.language); // "en" or "de"
boot.onLanguage((code) => (language = languageOf(code)));
// when the page goes away: boot.dispose()

What the starter does with tavora, and the rest of the SDK:

ts
import { TavoraError } from "@tavora/sdk";

const workspace = await tavora.workspace.getCurrent(); // { id: "poe2", displayName: "Path of Exile 2", kind: "game" }

// Small settings, private to this module in this workspace.
const count = (await tavora.storage.get<number>("count")) ?? 0;
await tavora.storage.set("count", count + 1);

// Documents are shared by all panels of this module in this workspace.
const plan = await tavora.documents.get<{ steps: string[] }>("plan");
try {
  await tavora.documents.put({ id: "plan", title: "Plan", data: { steps: ["Act 1"] }, ifRevision: plan?.revision ?? 0 });
} catch (error) {
  if (error instanceof TavoraError && error.code === "CONFLICT") {
    // Another panel saved first: reload instead of overwriting.
  }
}
tavora.documents.onChange(({ id }) => console.log(`${id} changed in another panel`));

// State for this one panel (open tab, scroll position). Removed when the panel closes.
await tavora.panel.setState({ tab: "gear" });

tavora.workspace.onResize(({ width, height }) => {});
tavora.lifecycle.onSuspend(() => {}); // hidden: pause timers and animations
tavora.lifecycle.onResume(() => {});

bootstrapModule calls connect() for you. connect() can be called any number of times and always returns the same connection. It rejects with a TavoraError when the page runs outside Tavora (HOST_UNAVAILABLE) or the host speaks another protocol version (INCOMPATIBLE).

Every failed call rejects with a TavoraError. Check error.code, not the message. The codes and limits are in the bridge protocol, and every method is in the SDK reference.

Values you store must be JSON. Type parameters such as get<number>() are not checked at runtime.

Where data lives ​

Settings go in tavora.storage, the user's work in tavora.documents, pictures in tavora.blobs and where a panel is scrolled to in tavora.panel. Which to use when, and how two open panels avoid overwriting each other, is in Saving data.

More from the host ​

APIWhat it does
tavora.ui.getLanguage(), onLanguageChangeThe language of Tavora's own texts ("en", "de"). Show your module in it, or in English when you have no translation.
tavora.blobsPictures too big for a document: up to 50 MB each and 500 MB per module and workspace. put a file, show it with url(id). See Files.
tavora.clipboard.writeImage(png)Puts a PNG on the system clipboard. Call it from the click or key press that asked for it. See Clipboard.
tavora.links.open(url)Opens a web address in the workspace's Browser panel, from a click or key press.
tavora.network.fetch(url, init)A web request to a host listed in permissions.network, once the user granted it. See Network.
tavora.connectors.aiUsageThe usage of the user's Claude and Codex accounts, with the ai-usage connector.
tavora.connectors.systemInfoYour PC's hardware, how busy it is (CPU, graphics card, memory, drives) and how its connection is doing (ping, lost pings, drops), with the system-info connector.
tavora.connectors.mediaWhat plays on the PC (Spotify, browsers, video players) with play/pause, next and previous, with the media connector.
tavora.connectors.discordThe Discord app on this PC through Tavora's Discord sign-in, with the discord connector: voice channels, mute and deafen, voice events.

What reaches outside the panel needs the user's yes first; see Permissions and consent. Following the theme and the language is in Look and languages.

Made for one game ​

A module made for one game, such as a build planner for Path of Exile 2, lists that game in its manifest:

json
"games": ["poe2"]

Tavora then offers it only in workspaces of that game: anywhere else it is not in Add module at all. "games": [] means any game. The starter asks which game the module is for and fills this in. The ids of Tavora's built-in games are in the manifest reference.

Every item on Tavora's rail is a workspace: a game workspace, linked to a game, or a personal workspace, which belongs to no game, for modules such as notes or a whiteboard. A module for any game is offered in personal workspaces too. If yours only makes sense in a game, add "personalWorkspaces": false (Tavora 0.21.43 or newer; set minTavora to at least 0.21.43). tavora.workspace.getCurrent() says which one a panel is in: its kind is "game" or "personal", and for a game workspace the id is the game's. tavora.game.getCurrent() and the manifest's workspaces field still work, but they are deprecated and go away before 1.0.

Build the module ​

  • Bundle everything. A module's page has no network access, so no CDN scripts, web fonts or remote images. To reach a web API, name its host in permissions.network and call network.fetch once the user has granted it.
  • Use relative asset paths (Vite: base: "./"). moduleConfig() from @tavora/pack/vite sets this and the rest of what a module's build needs (a self-contained dist/ for Tavora's browser, one input per page); the starter's vite.config.ts is just export default defineConfig(moduleConfig({ plugins: [vue()] })). Add pages: ["index", "overlay"] for more pages and notices: { VUE: "vue", MODULE: "./LICENSE" } to copy licence files into dist/. Its tsconfig.json extends @tavora/pack/tsconfig.module.json. The page is served from tavora-module://<module-id>/.
  • Don't use Ctrl+K (Cmd+K on macOS) as a shortcut. Tavora takes it for its own search before your page sees the key.
  • Point the manifest's entry at the built HTML file.
  • Add "$schema" to the manifest so your editor checks it. The schema is published at https://docs.mytavora.app/schema/tavora.module.schema.json.

Share the module ​

Publish from Tavora: open Settings > Developer and press Publish next to your module. The first time, Tavora walks you through signing in and choosing a developer name; saving the name makes your publisher key and claims your prefix. Tavora keeps the key for you, and your recovery key is its backup. Read Your publisher key before your first publish: updates and your users' data depend on that key.

Tavora packs what's already built, so keep dev running or run the build script first. The review screen shows what will go out: the name, version, patch notes, what the module asks for, and when it was built. When the catalog has this version already, it offers the next one and a box for its patch notes, and Save to project writes both into your files. Press Publish there to sign and upload; users find your module under Browse in the module library.

The part of your module id before the first dot is your prefix, usually your developer name. Once it's yours, nobody else can publish under it; an account holds up to 3, and Add another under Module developer claims more. A module stays with the key that published its first version, and each new version must be newer. An account can publish 10 versions a day. Publishing to the catalog covers the listing, updates, limits and reports.

To share by hand instead, press Save as zip next to Publish (or in the module's menu in Add module). The zip holds tavora.module.json, the folder your entry is in (usually dist/), the icon and the changelog, plus tavora.signature.json; your sources and node_modules stay out. When entry sits next to tavora.module.json, everything in the folder goes in except dot files and node_modules, so build into dist/ instead. A private key never goes in: if one would (a .pem, .key, .p12, .pfx or .ppk file, or a file holding a private key), Tavora stops and names it. Users install it with Settings > Modules > Install zip.

To publish from a build server, see Publish from CI.

While you build, keep loading the module from its development folder: it needs no key, and its data is kept apart from the signed version's.

Patch notes ​

Tell users what changed in changelog.json, which the starter makes and the manifest's changelog names. Add an entry, newest first, every time you raise version:

json
[
  { "version": "0.2.0", "date": "2026-11-02", "notes": ["Filter quests by act.", "Fixed the timer after a game switch."] },
  { "version": "0.1.0", "notes": ["First version."] }
]

Users read them under the module in Settings > Modules > Patch notes. After an update, the notes newer than the version they had are marked New until they open them. Each line is plain text of at most 500 characters, at most 20 lines per version and 100 versions; Publishing refuses a changelog Tavora could not show. Needs Tavora 0.18.2 or newer, so set minTavora to at least 0.18.2.

Something not working? See Troubleshooting.

For Tavora 0.24.58 and @tavora/sdk 0.3.20. Code under the MIT License. The Tavora name and logo are not covered by it.