Skip to content

Write the plugin manifest

The manifest is plugins/<name>/tilecast.plugin.json. Tilecast validates it at build time and when the server hosts the plugin.

Use the generated JSON Schema in your editor. The exact field rules live in the Plugin Manifest API 3, Plugin API v2, and shared plugin contract engineering references.

These fields describe the plugin in the catalog:

  • apiVersion is 3 for a new plugin that stores instances or settings, and 2 for one that does not. Plugin API v1 is retired, and Tilecast refuses a manifest with apiVersion 1.
  • id is the stable snake_case identifier.
  • definitionVersion versions the plugin’s persisted and Player-facing definition.
  • name, description, category, and icon describe it in Studio.
  • maintainers lists the people or teams responsible for the subject.
  • instanceNoun gives the singular and plural name shown with instance counts.
  • requirements tells an operator what the plugin expects before installation.
  • uses is plain catalog text describing the Tilecast capabilities it uses.

The directory name is the ID with underscores changed to hyphens.

Only declare capabilities the implementation uses.

{
"capabilities": {
"backgroundWorkers": true,
"network": ["api.example.org"]
}
}

backgroundWorkers is required for a WorkerProvider. network lists server-side hosts a Plugin API v2 plugin contacts; a Plugin Manifest API 3 plugin declares connections instead. Player behavior is a player contribution, described below.

plugin.CheckDeclarations compares the manifest with the Go interfaces the plugin implements.

The build uses fixed paths:

{
"server": { "entrypoint": "./plugin.go" },
"studio": {
"route": "/plugins/transit-alerts",
"entrypoint": "./studio/index.tsx"
},
"player": {
"runtime": { "entrypoint": "./runtime/index.ts" }
}
}

Leave out studio when the plugin has no Studio pages.

Player behavior is its own optional contribution. Leave out player entirely when the plugin does nothing on screens.

{
"player": {
"state": [{ "type": "transit_alert", "version": 1 }],
"runtime": {
"entrypoint": "./runtime/index.ts",
"services": {
"required": ["player.clock@1", "player.surface@1"],
"optional": ["player.presentation.observe@1"]
},
"surfaces": [
{ "id": "ticker", "slots": ["strip.bottom"], "tier": "scheduled" }
]
}
}
}
  • state lists the Player state types the plugin’s server projects and its Player behavior reads.
  • runtime is portable Player behavior in the Shared Runtime. services lists what it needs; a Player without a required service doesn’t run it, and a missing optional service is just unavailable.
  • surfaces gives each visual contribution its own slots and tier. Only declare it when you request player.surface@1.
  • native lists first-party native contributions, each a Rust crate in native/<id>/. The crate exports contribution(), and plugins:generate links it into the Player builds that include native plugins.
  • events lists the ephemeral events between your native part and your Shared Runtime part: a name, a version, and the source that raises it (native or runtime). Declare it with player.events@1 and both parts.
  • providers (inside runtime) lists the presentation providers you offer with player.presentation.provide@1.

If older Players must keep showing your plugin, list the entry types they understand in v1ManifestTypes. Countdown Bar and Emergency Alerts do this.

A plugin with HTTP routes declares the prefixes it owns and its OpenAPI fragment:

{
"api": {
"basePaths": ["/plugins/transit-alerts"],
"openapi": "./api/openapi.yaml"
}
}

The server refuses route collisions with core or another plugin.

studio.route is the management route under /plugins/<directory>.

Use studio.additionalRoutes when the plugin owns a separate Studio surface such as a portal or inbox. The Studio definition must contribute matching standaloneRoutes.

A plugin can dress up its Plugin Store page with a second file, plugins/<name>/tilecast.store.json. It holds presentation only:

{
"publisher": { "name": "Tilecast", "url": "https://tilecast.org" },
"longDescription": "A few sentences for the page's About section.",
"artwork": {
"icon": "./store/icon.webp",
"screenshots": [
{ "src": "./store/01-overview.webp", "alt": "What the screenshot shows." }
]
}
}

Keep the images in the plugin’s store/ folder as .webp or .png. Use up to five screenshots at one size, 16:9 (about 1920 × 1080), and write alternative text for each. Attach the file in plugin.go with .WithStore(...). Tilecast checks the paths when the server starts, so a typo is a build failure rather than a broken image.

The file never changes what the plugin is or does. Identity, requirements, capabilities, and trust all still come from tilecast.plugin.json. A plugin without a Store file still works and shows its built-in icon and no screenshots. See the engineering reference for every rule.

A plugin can publish pages from its own directory:

{
"docs": {
"pages": [
{
"source": "./docs/index.mdx",
"slug": "operations/plugins/transit-alerts"
}
]
}
}

The docs build checks slug collisions and adds declared pages to the public docs collection. The docs sidebar doesn’t list plugin pages. Link your page from the plugin catalog page, apps/docs/src/content/docs/operations/plugins.mdx, so readers can find it. A docs test fails when a declared page has no link there.

Settings and instances (Plugin Manifest API 3)

Section titled “Settings and instances (Plugin Manifest API 3)”

If your plugin declares instances or uses a generated organization settings page in Studio, provide api.basePaths for the host’s API routes.

A version 3 plugin describes what it stores, and Tilecast stores it. You write no tables, routes, API description, or Studio pages for ordinary instances.

{
"apiVersion": 3,
"api": { "basePaths": ["/plugins/room-sign"] },
"studio": { "route": "/plugins/room-sign" },
"settings": {
"organization": [
{ "key": "apiToken", "label": "API token", "control": "secret" }
]
},
"instances": [
{
"kind": "sign",
"noun": { "singular": "sign", "plural": "signs" },
"path": "signs",
"operations": { "singular": "RoomSign", "plural": "RoomSigns" },
"targeting": "screens",
"schedule": "none",
"priority": { "minimum": -10, "maximum": 10, "default": 0 },
"fields": [
{
"key": "title",
"label": "Title",
"control": "text",
"required": true
}
]
}
]
}
  • A plugin has at most sixteen instance kinds. Studio shows two to four as tabs and more as a drop-down, and each kind’s address stays the same either way.
  • A plugin doesn’t need instances at all. With "instances": [], its page opens on the first thing it has: settings, connections, feeds, webhooks, or status.
  • targeting is screens or none. schedule is none, window, or weekly.
  • fields use the same vocabulary as Widget settings, plus secret. A secret is encrypted and never shown again.
  • personal marks a field that holds personal data and says how long to keep it.
  • Tilecast saves each change with a revision, so two people editing at once can’t overwrite each other.

You then write two small hooks in Go: one that checks an instance makes sense, and one that turns an instance into what a Player shows. See the Plugin Manifest API 3 reference for the details, including the service client and what isn’t available yet.

A version 3 plugin never opens its own network connection. It declares each service it talks to, and an Owner or Administrator creates the connection in Studio.

{
"services": ["http.fetch@1", "secrets.read@1"],
"connections": [
{
"id": "calendar",
"title": "Calendar API",
"type": "http",
"origins": ["https://api.example.com"]
},
{
"id": "gateway",
"title": "Meter gateway",
"type": "http",
"origins": "operator",
"privateNetwork": "allowed",
"plainHttp": "allowed"
}
],
"settings": {
"organization": [
{
"key": "calendar",
"label": "Calendar",
"control": "connection",
"connections": ["calendar"]
},
{ "key": "apiToken", "label": "API token", "control": "secret" }
]
}
}
  • origins is a list of https origins, or operator when the operator enters one. An origin is a scheme, host, and port, with no path.
  • privateNetwork and plainHttp say what a connection could do. Each still needs its own permission from the operator. Plain HTTP works only with an operator origin on a private address.
  • allowPlaintextSecret lets a secret travel over plain HTTP after a third permission.
  • maxResponseBytes (up to 16 MiB) and timeoutSeconds (up to 60) raise the defaults of 1 MiB and 10 seconds. The install review shows a raised limit.
  • A connection field stores the ID of a connection record. List the declarations it accepts in connections.

A service that signs people in with OAuth 2.0, such as Google Calendar or Square, uses type: "oauth2". Tilecast runs the sign-in, keeps the tokens, renews them, and adds the Authorization: Bearer header to your http.fetch@1 requests. Your code never sees a token and must not send its own Authorization header on that connection.

{
"id": "google",
"title": "Google Calendar",
"type": "oauth2",
"origins": ["https://www.googleapis.com"],
"oauth": {
"authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
"tokenEndpoint": "https://oauth2.googleapis.com/token",
"revocationEndpoint": "https://oauth2.googleapis.com/revoke",
"scopes": ["https://www.googleapis.com/auth/calendar.readonly"],
"tokenEndpointAuthMethod": "client_secret_post",
"authorizationParameters": { "access_type": "offline", "prompt": "consent" }
}
}
  • Every endpoint and origin is https. An OAuth connection can’t use an operator origin, the private network, or plain HTTP.
  • Ask for the smallest read-only scopes the plugin needs. The install review lists them.
  • tokenEndpointAuthMethod is client_secret_basic, client_secret_post, or none. Use tokenRequestFormat: "json" only for a provider that takes JSON token requests.
  • Tilecast sets the standard parameters itself (client_id, redirect_uri, state, the PKCE challenge, and so on). authorizationParameters holds up to eight extra fixed values, such as access_type.
  • Changing an endpoint or a scope in a later release asks operators to connect again.
  • Handle these failure codes from http.fetch@1: oauth_not_connected, oauth_reconnect_required, and oauth_refresh_failed. Show the plugin as needing attention; don’t retry in a loop.

See Use a connection from server code for the request side, and the Plugin connections reference for every rule.

A feed is a set of records that your plugin publishes for Widgets. Tilecast stores it, lets operators change allowed fields, downloads images, and shows it as the Data Source <plugin id>.<feed id>. Don’t write a Data Source provider or an editor of your own.

{
"services": ["feeds.publish@1"],
"feeds": [
{
"id": "items",
"version": 1,
"title": "Menu items",
"dataset": "instance",
"instanceKind": "menu",
"expectedRefreshSeconds": 900,
"fields": [
{
"key": "name",
"label": "Name",
"control": "text",
"maxLength": 120,
"override": "local_until_changed"
},
{ "key": "price", "label": "Price", "control": "number", "minimum": 0 },
{
"key": "photo",
"label": "Photo",
"control": "url",
"image": { "connection": "images" }
}
]
}
]
}
  • dataset is organization for one dataset, or instance for one dataset per instance of instanceKind.
  • Fields use the configuration schema controls text, multiline_text, select, number, integer, boolean, date, datetime, and url, up to 16 fields. Text needs a maxLength of at most 4,096.
  • override says what operators may change: upstream (nothing, the default), local, or local_until_changed. Keep prices and availability upstream.
  • image turns a url field into an image that Tilecast downloads through the named connection. If the provider’s images live on a different host than its API, declare a separate http connection for the image host.
  • Mark personal fields with personal and a retention, as for settings.
  • Changing the fields means a new version.

See the Plugin feeds reference for every rule.