Skip to main content
User actions across apps
Group: Action APIs
Use this when you need: User actions across apps.

Usage

import { NeynarAPIClient, Configuration } from "@neynar/nodejs-sdk";

const client = new NeynarAPIClient(
  new Configuration({ apiKey: "YOUR_NEYNAR_API_KEY" })
);

const res = await client.publishFarcasterAction({
  farcasterActionReqBody: {
    signer_uuid: "19d0c5fd-9b33-4a48-a0e2-bc7b0555baec", // required
    base_url: "https://example.com", // required
    action: {
      type: "action_type", // required
      payload: { // optional
        // action-specific payload data
      }
    }
  }
});
console.log(res);

Parameters

ParameterTypeRequiredDescription
farcasterActionReqBodyFarcasterActionReqBody-
farcasterActionReqBody.signer_uuidstringThe signer_uuid of the user on behalf of whom the action is being performed. Must be paired with the API key
farcasterActionReqBody.base_urlstringThe base URL of the app on which the action is being performed
farcasterActionReqBody.actionFarcasterActionReqBodyActionThe action object containing type and optional payload
farcasterActionReqBody.action.typestringThe type of action being performed
farcasterActionReqBody.action.payloadobjectThe payload of the action being performed (optional, action-specific data)

Response

Returns a RequestArgs object.

Error Handling

try {
  const res = await client.publishFarcasterAction({
    farcasterActionReqBody: {
      signer_uuid: "19d0c5fd-9b33-4a48-a0e2-bc7b0555baec",
      base_url: "https://example.com",
      action: {
        type: "action_type",
        payload: {
          // action-specific payload data
        }
      }
    }
  });
  // use res
} catch (err) {
  // Axios/HTTP errors, invalid params, auth issues, etc.
  console.error(err);
}

Tips

  • Provide a viewerFid when supported to respect mutes/blocks and include viewer_context.
  • Keep requests scoped (e.g., use limit) to improve latency.
  • Cache results where sensible.