|
| 1 | +--- |
| 2 | +sidebar_position: 9 |
| 3 | +--- |
| 4 | + |
| 5 | +# 🟣 Farcaster Plugin |
| 6 | + |
| 7 | +The Farcaster plugin enables distribution of curated content to [Farcaster](https://farcaster.xyz) using the Neynar API. |
| 8 | + |
| 9 | +## 🔧 Setup Guide |
| 10 | + |
| 11 | +1. **Get Neynar API Credentials** |
| 12 | + - Sign up at [Neynar](https://neynar.com) and obtain your API key. |
| 13 | + - Create a signer in the Neynar dashboard and copy the `signerUuid`. |
| 14 | + |
| 15 | +2. **Add the Plugin to Your Configuration** |
| 16 | + |
| 17 | + In your `curate.config.json` or via the Plugin Manager UI, add the Farcaster plugin: |
| 18 | + |
| 19 | + ```json |
| 20 | + { |
| 21 | + "outputs": { |
| 22 | + "stream": { |
| 23 | + "enabled": true, |
| 24 | + "distribute": [ |
| 25 | + { |
| 26 | + "plugin": "@curatedotfun/farcaster", |
| 27 | + "config": { |
| 28 | + "apiKey": "{FARCASTER_API_KEY}", |
| 29 | + "signerUuid": "{FARCASTER_SIGNER_UUID}" |
| 30 | + } |
| 31 | + } |
| 32 | + ] |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | + ``` |
| 37 | + |
| 38 | + > **Tip:** Use environment variable placeholders (e.g., `{FARCASTER_API_KEY}`) and set them in your `.env` file for security. |
| 39 | +
|
| 40 | +## ⚙️ Configuration |
| 41 | + |
| 42 | +| Parameter | Type | Required | Description | |
| 43 | +|------------|--------|----------|---------------------------------------------| |
| 44 | +| apiKey | string | Yes | Your Neynar API key | |
| 45 | +| signerUuid | string | Yes | The UUID of your Neynar signer | |
| 46 | + |
| 47 | +- Get your API key and signer UUID from the [Neynar dashboard](https://neynar.com). |
| 48 | + |
| 49 | +## 🚀 Usage |
| 50 | + |
| 51 | +Once configured, the plugin will post content to Farcaster using the Neynar API whenever a distribution action is triggered. |
| 52 | + |
| 53 | +No additional setup is required after configuration. The plugin will use the provided credentials to publish casts. |
| 54 | + |
| 55 | +## 🛡️ Security Notes |
| 56 | + |
| 57 | +- **Never commit your API key or signer UUID to version control.** |
| 58 | +- Store sensitive credentials in environment variables or a secure configuration management system. |
| 59 | + |
| 60 | +## 📝 Example |
| 61 | + |
| 62 | +```typescript |
| 63 | +import { FarcasterPlugin } from '@curatedotfun/farcaster'; |
| 64 | + |
| 65 | +const plugin = new FarcasterPlugin(); |
| 66 | +await plugin.initialize({ |
| 67 | + apiKey: process.env.FARCASTER_API_KEY!, |
| 68 | + signerUuid: process.env.FARCASTER_SIGNER_UUID! |
| 69 | +}); |
| 70 | +await plugin.distribute({ input: 'Hello, Farcaster!', config: plugin["config"] }); |
| 71 | +``` |
| 72 | + |
| 73 | +## 🔗 Resources |
| 74 | +- [Farcaster](https://farcaster.xyz) |
| 75 | +- [Neynar API](https://docs.neynar.com/) |
0 commit comments