|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +# ⚙️ Configuration |
| 6 | + |
| 7 | +Configure your curate.fun instance through the `curate.config.json` file ⚡ |
| 8 | + |
| 9 | +## 🏗️ Structure |
| 10 | + |
| 11 | +### 🌍 Global Settings |
| 12 | + |
| 13 | +```json |
| 14 | +{ |
| 15 | + "global": { |
| 16 | + "botId": "curatedotfun", // @handle for twitter bot |
| 17 | + "defaultStatus": "pending", |
| 18 | + "maxDailySubmissionsPerUser": 15, |
| 19 | + "blacklist": { // ignore submissions according to inbound platform |
| 20 | + "twitter": [ |
| 21 | + "blocked_id" |
| 22 | + ] |
| 23 | + } |
| 24 | + } |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +### 🔌 Plugins |
| 29 | + |
| 30 | +Plugins extend functionality with transformations and distribution capabilities. See the [Plugins](/docs/plugins) section for detailed documentation on each plugin. |
| 31 | + |
| 32 | +```json |
| 33 | +{ |
| 34 | + "plugins": { |
| 35 | + "@curatedotfun/telegram": { |
| 36 | + "type": "distributor", |
| 37 | + "url": "https://unpkg.com/@curatedotfun/telegram@latest/dist/remoteEntry.js" |
| 38 | + }, |
| 39 | + "@curatedotfun/rss": { |
| 40 | + "type": "distributor", |
| 41 | + "url": "https://unpkg.com/@curatedotfun/rss@latest/dist/remoteEntry.js" |
| 42 | + }, |
| 43 | + "@curatedotfun/ai-transform": { |
| 44 | + "type": "transformer", |
| 45 | + "url": "https://unpkg.com/@curatedotfun/ai-transform@latest/dist/remoteEntry.js" |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +### 📡 Feeds |
| 52 | + |
| 53 | +Each feed represents a distinct content stream: |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "feeds": [ |
| 58 | + { |
| 59 | + "id": "example", // hashtag |
| 60 | + "name": "Example Feed", |
| 61 | + "description": "Example feed description", |
| 62 | + "moderation": { |
| 63 | + "approvers": { |
| 64 | + "twitter": ["approver1", "approver2"] // twitter handles, without @ |
| 65 | + } |
| 66 | + }, |
| 67 | + "outputs": { |
| 68 | + "stream": { |
| 69 | + "enabled": true, // if enabled but no distribute, then will sit in queue |
| 70 | + "transform": { // Optional |
| 71 | + "plugin": "@curatedotfun/ai-transform", |
| 72 | + "config": { |
| 73 | + "prompt": "Format this update..." |
| 74 | + } |
| 75 | + }, |
| 76 | + "distribute": [ // Optional (can be processed later, with /api/feed/:feedId/process) |
| 77 | + { |
| 78 | + "plugin": "@curatedotfun/telegram", |
| 79 | + "config": { |
| 80 | + "botToken": "{TELEGRAM_BOT_TOKEN}", |
| 81 | + "channelId": "{TELEGRAM_CHANNEL_ID}" |
| 82 | + } |
| 83 | + }, |
| 84 | + { |
| 85 | + "plugin": "@curatedotfun/rss", |
| 86 | + "config": { |
| 87 | + "title": "Feed Title", |
| 88 | + "path": "./public/feed.xml" |
| 89 | + } |
| 90 | + } |
| 91 | + ] |
| 92 | + }, |
| 93 | + "recap": { |
| 94 | + "enabled": false, |
| 95 | + "schedule": "0 0 * * *", |
| 96 | + "transform": { // Required to summarize |
| 97 | + "plugin": "@curatedotfun/ai-transform", |
| 98 | + "config": { |
| 99 | + "prompt": "./prompts/recap.txt" |
| 100 | + } |
| 101 | + }, |
| 102 | + "distribute": [ // Required for recap |
| 103 | + { |
| 104 | + "plugin": "@curatedotfun/telegram", |
| 105 | + "config": { |
| 106 | + "botToken": "{TELEGRAM_BOT_TOKEN}", // gets injected by .env |
| 107 | + "channelId": "{TELEGRAM_CHANNEL_ID}" |
| 108 | + } |
| 109 | + } |
| 110 | + ] |
| 111 | + } |
| 112 | + } |
| 113 | + } |
| 114 | + ] |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +## 🔄 Stream Configuration |
| 119 | + |
| 120 | +Stream configuration controls real-time content distribution: |
| 121 | + |
| 122 | +```typescript |
| 123 | +outputs: { |
| 124 | + stream?: { |
| 125 | + enabled: boolean; |
| 126 | + transform?: { // Optional transformation |
| 127 | + plugin: string; |
| 128 | + config: { |
| 129 | + prompt: string; |
| 130 | + }; |
| 131 | + }; |
| 132 | + distribute?: [ // Optional distribution, can configure multiple |
| 133 | + { |
| 134 | + plugin: string; |
| 135 | + config: Record<string, string>; |
| 136 | + } |
| 137 | + ]; |
| 138 | + }; |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +When `stream` is enabled: |
| 143 | + |
| 144 | +- 🔄 Without `transform`, content is distributed as-is |
| 145 | +- 📥 Without `distribute`, submissions stay in queue until: |
| 146 | + - ✅ Distribution is added later (/api/feeds/:feedId/process) |
| 147 | + - 📅 Recap schedule completes |
| 148 | + - 🗑️ Manual removal |
| 149 | + |
| 150 | +This queue system helps you: |
| 151 | + |
| 152 | +- 📦 Collect submissions for later |
| 153 | +- 🔌 Add distribution channels flexibly |
| 154 | +- 📝 Use content in recaps only |
| 155 | + |
| 156 | +## 📅 Recap Configuration |
| 157 | + |
| 158 | +Recap configuration handles periodic content summaries: |
| 159 | + |
| 160 | +```typescript |
| 161 | +outputs: { |
| 162 | + recap?: { |
| 163 | + enabled: boolean; |
| 164 | + schedule: string; // Cron expression |
| 165 | + transform: { // Required |
| 166 | + plugin: string; |
| 167 | + config: { |
| 168 | + prompt: string; |
| 169 | + }; |
| 170 | + }; |
| 171 | + distribute: [ // Required |
| 172 | + { |
| 173 | + plugin: string; |
| 174 | + config: Record<string, string>; |
| 175 | + } |
| 176 | + ]; |
| 177 | + }; |
| 178 | +} |
| 179 | +``` |
| 180 | + |
| 181 | +Key differences from stream configuration: |
| 182 | + |
| 183 | +- 🔄 `transform` is required (content must be summarized) |
| 184 | +- 📢 `distribute` is required (summaries must be distributed) |
| 185 | + |
| 186 | +📝 Note: Messages in a recap are removed from the queue after distribution. |
0 commit comments