🔌 Plugin Development
Learn how to extend curate.fun by developing custom plugins ⚡
🏗️ Plugin Architecture
The curate.fun plugin system is built on a modular architecture that supports three main types of plugins:
- Source Plugins: Monitor and collect content from platforms
- Transformer Plugins: Convert content from one format to another
- Distributor Plugins: Send content to external platforms or services
All plugins follow standardized interfaces and are loaded dynamically using module federation.
🧩 Plugin Interfaces
Core Plugin Interface
All plugins implement a base interface:
interface Plugin<TConfig extends PluginConfig> {
initialize(config: TConfig): Promise<void>;
shutdown?(): Promise<void>;
}
Transformer Plugin Interface
interface TransformerPlugin<TInput, TOutput, TConfig extends PluginConfig> extends Plugin<TConfig> {
transform(args: { input: TInput; config: TConfig }): Promise<TOutput>;
}
Distributor Plugin Interface
interface DistributorPlugin<TInput, TConfig extends PluginConfig> extends Plugin<TConfig> {
distribute(args: { input: TInput; config: TConfig }): Promise<void>;
}
Source Plugin Interface
interface SourcePlugin<TConfig extends PluginConfig> extends Plugin<TConfig> {
startMonitoring(): Promise<void>;
stopMonitoring(): Promise<void>;
}
🚀 Development Workflow
-
Setup Development Environment:
- Clone the plugin template or create a new package
- Install dependencies with
bun install
- Configure module federation
-
Implement Plugin Interface:
- Choose the appropriate interface (transformer, distributor, or source)
- Implement required methods
- Add proper error handling
-
Test Your Plugin:
- Use the Plugin Manager for local testing
- Verify functionality with sample data
- Test error scenarios
-
Package and Publish:
- Build your plugin with
bun run build
- Publish to npm or host the built files
- Update documentation
- Build your plugin with
🛠️ Development Tools
The curate.fun ecosystem provides several tools to help with plugin development:
- Plugin Manager: A UI tool for testing plugins during development
- Plugin Template: A starter template for creating new plugins
- Type Definitions: TypeScript interfaces for plugin development
📚 Best Practices
- Type Safety: Use TypeScript interfaces and generics for type safety
- Error Handling: Implement proper error handling and reporting
- Resource Management: Clean up resources in the shutdown method
- Configuration Validation: Validate plugin configuration during initialization
- Documentation: Document your plugin's functionality and configuration options
🔗 Next Steps
For detailed implementation guides and examples, check out:
- Build a Custom Plugin - Step-by-step guide
- Transformer Plugins - Transform content
- Distributor Plugins - Distribute content
- Source Plugins - Collect content