Neynar Documentation

User actions across apps

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

Parameter Type Required Description
farcasterActionReqBody FarcasterActionReqBody ✅ -
farcasterActionReqBody.signer_uuid string ✅ The signer_uuid of the user on behalf of whom the action is being performed. Must be paired with the API key
farcasterActionReqBody.base_url string ✅ The base URL of the app on which the action is being performed
farcasterActionReqBody.action FarcasterActionReqBodyAction ✅ The action object containing type and optional payload
farcasterActionReqBody.action.type string ✅ The type of action being performed
farcasterActionReqBody.action.payload object ❌ The 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