Publishing Plugins
Once your plugin is ready, you can publish it to npm so other tokentop users can install it.
Prerequisites
Section titled “Prerequisites”Your plugin should:
- Depend on
@tokentop/plugin-sdkfor types and helpers - Export a default plugin object matching one of the plugin interfaces
- Include a clear
package.jsonwith proper metadata
Package setup
Section titled “Package setup”{ "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" }}Naming conventions
Section titled “Naming conventions”Follow the naming conventions so tokentop and its users can discover your plugin:
| Tier | Pattern | Example |
|---|---|---|
| Community | tokentop-{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.
Testing before publishing
Section titled “Testing before publishing”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 methodsYou can also test locally by loading your plugin with the --plugin flag:
ttop --plugin ./path-to-your-pluginPublishing
Section titled “Publishing”npm publishOnce published, users install your plugin by adding it to their config:
{ "plugins": { "npm": ["tokentop-provider-my-service"] }}Keywords
Section titled “Keywords”Include these keywords in your package.json so users can find your plugin:
tokentoptokentop-plugintokentop-{type}(e.g.,tokentop-provider,tokentop-theme)