Back to Eliza

Farcaster Connector

packages/docs/connectors/farcaster.md

2.0.17.1 KB
Original Source

Farcaster Connector

Connect your agent to the Farcaster decentralized social protocol for casting, replies, and channel participation using the @elizaos/plugin-farcaster package.

Prerequisites

  • A Farcaster account with a known FID
  • A Neynar API key
  • A Neynar signer UUID associated with your Farcaster account

Configuration

NameRequiredDescription
FARCASTER_NEYNAR_API_KEYYesNeynar API key for authentication
FARCASTER_FIDYesFarcaster ID (FID) of the agent account
FARCASTER_SIGNER_UUIDYesNeynar signer UUID for signing casts
FARCASTER_HUB_URLNoFarcaster hub URL (default: hub.pinata.cloud)
FARCASTER_MODENoOperation mode: polling or webhook (default: polling)
FARCASTER_POLL_INTERVALNoPolling interval in seconds (default: 120)
FARCASTER_DRY_RUNNoSimulate operations without executing them
ENABLE_CASTNoEnable posting casts (default: true)
CAST_IMMEDIATELYNoPost immediately instead of on schedule (default: false)
CAST_INTERVAL_MINNoMinimum minutes between autonomous casts (default: 90)
CAST_INTERVAL_MAXNoMaximum minutes between autonomous casts (default: 180)
MAX_CAST_LENGTHNoMaximum characters per cast (default: 320)
ENABLE_ACTION_PROCESSINGNoEnable automated action processing (default: false)
ACTION_INTERVALNoMinutes between action-processing cycles (default: 5)
MAX_ACTIONS_PROCESSINGNoMaximum actions per batch (default: 1)

These can be set as environment variables or under the connectors.farcaster config in ~/.eliza/eliza.json:

json
{
  "connectors": {
    "farcaster": {
      "apiKey": "YOUR_NEYNAR_API_KEY",
      "signerUuid": "YOUR_SIGNER_UUID",
      "fid": 12345
    }
  }
}

The connector auto-enables when apiKey is truthy in the connector config and enabled is not explicitly false.

Setup

json
{
  "connectors": {
    "farcaster": {
      "apiKey": "YOUR_NEYNAR_API_KEY",
      "signerUuid": "YOUR_SIGNER_UUID",
      "fid": 12345,
      "enabled": false
    }
  }
}

Auto-Enable Mechanism

The plugin-auto-enable.ts module checks connectors.farcaster in your config. If the apiKey field is truthy (and enabled is not explicitly false), the runtime automatically loads @elizaos/plugin-farcaster.

The connector can also be enabled via the FARCASTER_NEYNAR_API_KEY environment variable (used as the primary env key in the plugin registry). Additional env vars supported: FARCASTER_FID, FARCASTER_SIGNER_UUID, FARCASTER_POLL_INTERVAL, FARCASTER_HUB_URL, FARCASTER_DRY_RUN, FARCASTER_MODE.

Environment Variables

VariableDescription
FARCASTER_NEYNAR_API_KEYNeynar API key. When set, the runtime maps this to the connector's apiKey field. Can be used as an alternative to placing the key directly in eliza.json.

Environment Variables

When the connector is loaded, the following environment variables are consumed by the plugin:

VariableRequiredDefaultDescription
FARCASTER_NEYNAR_API_KEYYesNeynar API key for authentication
FARCASTER_SIGNER_UUIDYesUUID of the Neynar signer for signing casts
FARCASTER_FIDYesFarcaster ID (user identifier) for the agent account
FARCASTER_HUB_URLNohub.pinata.cloudFarcaster hub URL
FARCASTER_POLL_INTERVALNo120Polling interval in seconds
FARCASTER_DRY_RUNNofalseSimulate operations without executing
FARCASTER_MODENopollingOperation mode: polling or webhook
ENABLE_CASTNotrueEnable or disable posting casts
CAST_IMMEDIATELYNofalsePublish casts immediately instead of on a schedule
CAST_INTERVAL_MINNo90Minimum interval in minutes between automated casts
CAST_INTERVAL_MAXNo180Maximum interval in minutes between automated casts
MAX_CAST_LENGTHNo320Maximum characters per cast
ACTION_INTERVALNo5Interval in minutes between action-processing cycles
ENABLE_ACTION_PROCESSINGNofalseEnable automated action processing
MAX_ACTIONS_PROCESSINGNo1Maximum actions to process in a single batch

Full Configuration Reference

All fields are defined under connectors.farcaster in eliza.json.

Core Fields

FieldTypeDefaultDescription
apiKeystringNeynar API key (required)
signerUuidstringNeynar signer UUID for the agent account (required)
fidnumberFarcaster ID of the agent account (required)
enabledbooleanExplicitly enable/disable
channelsstring[]Farcaster channel names to monitor and participate in
pollIntervalnumber120Seconds between mention checks
mode"polling" | "webhook""polling"Operation mode
dryRunbooleanfalseSimulate operations without executing
hubUrlstringhub.pinata.cloudFarcaster hub URL

Autonomous Casting

The agent can post casts autonomously at random intervals. The LLM generates cast content based on the character's personality and current context.

FieldTypeDefaultDescription
castIntervalMinnumber90Minimum minutes between autonomous casts
castIntervalMaxnumber180Maximum minutes between autonomous casts
castImmediatelybooleanfalsePublish casts immediately
maxCastLengthnumber320Maximum characters per cast

Action Processing

FieldTypeDefaultDescription
actionIntervalnumber5Minutes between action-processing cycles
enableActionProcessingbooleanfalseEnable automated action processing
maxActionsProcessingnumber1Max actions to process per batch
json
{
  "connectors": {
    "farcaster": {
      "apiKey": "...",
      "signerUuid": "...",
      "fid": 12345,
      "channels": ["ai", "agents"],
      "castIntervalMin": 90,
      "castIntervalMax": 180
    }
  }
}

Cast Limits

Casts are limited to 320 characters. Longer responses are automatically split into cast threads.

DM Policy

Farcaster supports direct casts (private messages via Warpcast). The connector handles incoming direct casts as DM conversations.

Features

  • Autonomous casting -- Posts in the agent's voice at configurable intervals
  • Replies -- Responds to @mentions and replies to the agent's casts
  • Reactions -- Likes and recasts
  • Channel monitoring -- Participates in Farcaster channels
  • Direct casts -- Private DM-like messages (Warpcast feature)
  • On-chain identity -- Agent identity is tied to an Ethereum address
  • Thread splitting -- Messages over 320 characters are split into cast threads