📤 Distribution System
The distribution system enables content delivery through various platform-specific plugins. Each distributor plugin handles the formatting and delivery of content to a specific platform or service.
🏗️ Architecture
Distribution Pipeline
Content flows through three main stages:
- Pre-Distribution Transform: Optional per-distributor content transformation
- Content Formatting: Platform-specific content formatting
- Content Delivery: Actual distribution to the target platform
Configuration Placement
Distributors are configured in your curate.config.json under the feed's outputs section:
{
  "feeds": [{
    "outputs": {
      "stream": {
        "distribute": [
          {
            "plugin": "@curatedotfun/telegram",
            "config": {
              // Distributor-specific configuration
            },
            "transform": [
              // Optional per-distributor transforms
            ]
          }
        ]
      }
    }
  }]
}
🔌 Available Distributors
- Telegram - Send messages to Telegram channels
- Notion - Add entries to Notion databases
- RSS - Generate RSS feeds
- Supabase - Store content in Supabase
- NEAR Social - Post content to NEAR Social
🔒 Type Safety
Distributor plugins use TypeScript interfaces to ensure type safety:
interface DistributorPlugin<TInput, TConfig> {
  distribute(args: { input: TInput, config: TConfig }): Promise<void>;
}
interface DistributionResult {
  success: boolean;
  error?: Error;
  metadata?: Record<string, any>;
}
🚀 Best Practices
- Use Per-Distributor Transforms for platform-specific formatting
- Handle Rate Limits for API-based distributors
- Implement Retries for transient failures
- Monitor Distribution Status for reliability
- Document Platform Requirements for custom distributors
tip
Configure error handling and retries appropriately for each distributor to ensure reliable content delivery.
🔄 Distribution Flow
The distribution process follows these steps:
- Content Input: The content to be distributed enters the system
- Per-Distributor Transform: Content is transformed specifically for the target platform
- Platform Format: Content is formatted according to platform requirements
- Content Delivery: Content is sent to the target platform
- Status Check: The system checks if distribution was successful
- If successful: The distribution process is complete
- If failed: The retry logic is triggered
 
- Retry Logic: Failed distributions are retried with appropriate backoff
- Return to Format: The retry process starts again from the formatting step
This flow ensures reliable content delivery with appropriate error handling and retry mechanisms.