Skip to content

Publishing Plugins

Once your plugin is ready, you can publish it to npm so other tokentop users can install it.

Your plugin should:

  1. Depend on @tokentop/plugin-sdk for types and helpers
  2. Export a default plugin object matching one of the plugin interfaces
  3. Include a clear package.json with proper metadata
{
"name": "tokentop-provider-my-service",
"version": "1.0.0",
"description": "tokentop provider plugin for My Service",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"keywords": ["tokentop", "tokentop-plugin", "tokentop-provider"],
"peerDependencies": {
"@tokentop/plugin-sdk": ">=1.0.0"
}
}

Follow the naming conventions so tokentop and its users can discover your plugin:

TierPatternExample
Communitytokentop-{type}-<name>tokentop-provider-replicate
Scoped@scope/tokentop-{type}-<name>@myname/tokentop-theme-catppuccin

The @tokentop/* scope is reserved for official plugins.

Replace {type} with one of: provider, agent, theme, notification.

Use the plugin SDK’s test harness to validate your plugin works correctly:

import { createTestHarness } from '@tokentop/plugin-sdk/testing';
import myPlugin from './index';
const harness = createTestHarness(myPlugin);
// Run assertions against harness methods

You can also test locally by loading your plugin with the --plugin flag:

Terminal window
ttop --plugin ./path-to-your-plugin
Terminal window
npm publish

Once published, users install your plugin by adding it to their config:

{
"plugins": {
"npm": ["tokentop-provider-my-service"]
}
}

Include these keywords in your package.json so users can find your plugin:

  • tokentop
  • tokentop-plugin
  • tokentop-{type} (e.g., tokentop-provider, tokentop-theme)