- The factory, which operators call in
kaneo.config.tsto add the plugin and set its options. - The server entry, which Kaneo’s API loads at startup. It adds routes, reacts to events, and stores data.
- The web entry, which the browser loads in workspaces that turned the plugin on. It adds views, panels, pages, and commands.
@kaneo/plugin-sdk provides the types, the helpers, and the kaneo-plugin build command. The quickest start is to copy the task progress example, which this page follows.
For operator setup, see Plugins. For every signature and field, see the plugin reference.
Package anatomy
tsconfig.json for editor support and type checking:
exports:.is the factory used inkaneo.config.ts. Keep itstypescondition so operators get type checking for your options../serveris the API entry and./webis the browser entry. You can ship only one of them, but at least one is required, and both must point to files inside the package.engines.kaneo: the Kaneo versions your plugin supports, as a semver range. Kaneo refuses to start a plugin whose range does not include the running version.keywords: includekaneo-pluginso people can find your package on npm.kaneo.name: optional. The name shown under Settings → Workspace → Plugins. Defaults to the package name.kaneo.id: optional. Overrides the plugin ID.dependencies: leave this empty. The build bundles everything your code imports, so operators install a single self-contained package.
Plugin ID
The ID namespaces your routes and your stored data. By default Kaneo derives it from the package name: lowercase, without the leading@, with each run of other characters replaced by -, and at most 64 characters.
To pick a shorter one, set
"kaneo": { "id": "task-progress" }. An ID must start with a lowercase letter or digit and contain only lowercase letters, digits, and -.
Keep the ID stable once you publish. Data stored under an old ID is not moved to a new one.
Define the plugin
src/index.ts exports the factory:
import.meta.url as written. Kaneo uses it to find your package from the operator’s config.
options accepts any Standard Schema validator, such as Zod, Valibot, or ArkType. Its input type becomes the argument type in kaneo.config.ts, and its output type becomes kaneo.options on the server. When every option has a default, operators can call taskProgress() without an argument.
A plugin without options calls definePlugin(import.meta.url).
Options and settings
A plugin has two kinds of configuration:
Use options for instance-wide behavior and credentials that operators read from the environment. Use settings for choices that differ between teams, including per-workspace secrets.
Server entry
src/server.ts exports the server definition. Pass your factory as the first argument so kaneo.options gets its type:
defineServer({ settings, setup }) instead.
setup runs once at startup and may be async. If it throws, Kaneo stops at the start stage.
What setup receives
Plugins work through this context and never through Kaneo’s database tables. That keeps workspace permissions enforced and lets Kaneo change its schema without breaking plugins.
Routes and guards
Routes go through Kaneo’s normal session and API key authentication. Add a guard to any route that touches workspace data. A guard reads an ID from the named route parameter (workspaceId, projectId, or taskId by default), checks that the signed-in user can access that workspace and has the listed permissions, and sets c.get("workspaceId"). It responds with 404 when the plugin is off in that workspace.
Return errors with c.json(body, status). Do not register routes whose first path segment is assets, data, workspace, or webhooks; Kaneo uses those.
Events
kaneo.on handlers receive typed events such as task.created, task.status_changed, and comment.created. Every event carries workspaceId, projectId, and actorId; task and comment events also carry taskId. Events reach workspaces that turned your plugin on. A project move also reaches plugins with retained storage in the source workspace. Storage belongs to a workspace, so if you store data per project, handle project.moved to move it when a project changes workspace. Events report changes that already happened; a handler cannot change or block them. An error in a handler is logged and does not affect Kaneo. See the event list.
Webhooks
Webhook routes have no user and no workspace, so verify each request yourself. This example expects the workspace ID in the URL and a shared secret that workspace admins enter as a setting:https://kaneo.example.com/api/plugins/<id>/webhooks/<workspaceId>.
Scheduled jobs
Cron schedules use UTC. Kaneo attempts each occurrence at most once across API instances. An interrupted job can leave partial work, so write callbacks that can pick up where the last occurrence stopped. Jobs are not tied to a workspace. Loop over the workspaces that use your plugin:Settings
Declare settings as form fields. Kaneo renders the form, validates input, and types the values thatkaneo.settings() returns:
doneStatus is a string, apiToken is string | undefined, threshold is a number, notify is a boolean, and mode is "manual" | "automatic". Declare settings inline in defineServer so option values keep their literal types. The settings reference lists every field type.
Web entry
src/web.tsx exports the web definition. Every key is optional:
Views and pages also accept an
icon, any React component that takes a className. Kaneo renders each contribution inside its own error boundary and suspense boundary, and only in workspaces that turned the plugin on.
Project views
A project view is a layout, like Board, List, and Calendar. Kaneo puts it in the layout switch, keeps its own search, filters, and task count above it, and hands your component the tasks that match throughuseProjectView():
scope: "schedule" adds the backlog’s planned tasks to the board’s tasks, as Calendar does. display renders controls in the Display menu below the layout switch, and countsTask decides which tasks the task count includes. With shortcut: "a", pressing v then a opens the layout, and the shortcuts panel lists it. The project views reference covers every field.
Hooks
Components read Kaneo’s state through hooks from@kaneo/plugin-sdk/web:
The hooks only work inside Kaneo’s web app.
Shared React and query cache
Kaneo providesreact, react-dom, and @tanstack/react-query to your web entry. The build leaves them out of your bundle, so your components run on Kaneo’s React instance and share its query cache. Keep them in devDependencies for types, and start your query keys with your plugin ID, as above, so they never collide with Kaneo’s. Everything else you import, such as an icon library, is bundled into your files.
UI components
@kaneo/plugin-sdk/ui exports Kaneo’s own Button, Badge, Input, Textarea, Label, Switch, Spinner, Skeleton, and Separator, plus WeekStartControl for a project view’s display controls. They render with Kaneo’s styles in light and dark mode. See the component props.
Styling
Import a stylesheet from your web entry, assrc/web.tsx does above. It is loaded with your plugin and applies to the whole page, so give your own class names a prefix, such as your plugin ID.
Plain CSS. Use Kaneo’s CSS variables. They switch with the light and dark theme automatically:
tailwindcss as a dev dependency and start your stylesheet with a prefix of lowercase letters, such as your plugin ID without dashes:
taskprogress:flex or taskprogress:md:hidden. Your CSS loads into Kaneo’s page after Kaneo’s own Tailwind classes, so an unprefixed .hidden or .flex from your plugin would override Kaneo’s layout. kaneo-plugin build fails when your CSS defines unprefixed Tailwind classes like these.
@kaneo/plugin-sdk/theme.css maps Tailwind’s tokens to Kaneo’s variables, so classes such as bg-background, text-muted-foreground, border-border, bg-primary, and rounded-lg match the app, and dark: follows Kaneo’s theme. Leave out Tailwind’s preflight: Kaneo already provides base styles, and loading them again would restyle the page around your plugin.
Build
kaneo-plugin build writes:
Every dependency is bundled in, except the shared modules Kaneo provides. Plugins cannot use install scripts or native modules: the same files must work on a laptop, in a container, and on any CPU architecture.
Run
kaneo-plugin build --watch to rebuild when files change. In a terminal, the command prints each step and a summary of the files. When its output goes to a pipe or a CI log, or with --json, it prints one JSON object with the plugin, the files, and any warnings, or {"error": "..."} with exit code 1. Pass --human to keep the terminal output.
Develop locally
The Kaneo repository contains the task progress plugin inexamples/plugins/task-progress and an instance that uses it in examples/instance.
- Clone Kaneo and follow its local development setup.
-
Build the example plugin:
-
Point Kaneo at the example instance. Add the absolute path to the repository’s root
.env: -
Start Kaneo with
pnpm dev, open Settings → Workspace → Plugins, and turn on Task progress.
pnpm dev.
To work on your own plugin the same way, copy examples/plugins/task-progress to a new folder under examples/plugins/, rename the package, add it to examples/instance/package.json as "workspace:*", run pnpm install, and import it in examples/instance/kaneo.config.ts.
Publish
-
Check
package.json: a uniquename, a newversion, thekaneo-pluginkeyword, anengines.kaneorange,"files": ["dist"], and nodependencies. -
Build and publish:
>=2.29.0 <3, is a good default. When a new Kaneo major ships, test your plugin against it and widen the range in a new release.
Get listed
The plugins page on kaneo.app lists community plugins, andkaneo plugin add warns before adding a package that is not listed. To get listed, publish your plugin, then open a pull request that adds an entry to catalog/index.json. The catalog guide has the requirements, the entry format, and the checks to run first.
Listing is a light review, not a security audit. A Kaneo maintainer checks the entry and the published package, not every line of your code.