neynarxyz / nodejs-sdk

Typescript SDK for Neynar APIs
https://neynar.com
MIT License
53 stars 11 forks source link

feat: `searchCasts` now takes `viewerFid` so that it can return the viewer context #169

Closed valerierose closed 2 months ago

valerierose commented 2 months ago

Example

# index.js
const result = await client.searchCasts("wowow", {viewerFid: 489795, limit: 3});
console.log(JSON.stringify(result));
$ node index.js | jq '.result.casts[] | {text: .text, author: {fid: .author.fid, viewer_context: .author.viewer_context}, viewer_context: .viewer_context}'

{
  "text": "Whether you're in 'founder mode' or 'manager mode', you need to make sure your marketing team understands your product.\n\nThis will help you 👇 \nhttps://mirror.xyz/cryptotaboo.eth/wq--HTfY22a36LpO_XdVJ-qCj_yzMt73-tZMoDNeuMk",
  "author": {
    "fid": 308042,
    "viewer_context": {
      "following": false,
      "followed_by": false
    }
  },
  "viewer_context": {
    "liked": false,
    "recasted": false
  }
}
{
  "text": "founder mode just turned off...",
  "author": {
    "fid": 408262,
    "viewer_context": {
      "following": false,
      "followed_by": false
    }
  },
  "viewer_context": {
    "liked": false,
    "recasted": false
  }
}
{
  "text": "Yeah this doesn’t feel groundbreaking— founder mode has always been a thing we just didn’t have this name for it. \n\nThere’s also plenty of examples of founders who wouldn’t give up power/micromanage and that also doesn’t work well for scaling. \n\nI would love to see some research/dara that shows what the actual results are for different approaches so if that results for this interest then great!",
  "author": {
    "fid": 4167,
    "viewer_context": {
      "following": false,
      "followed_by": false
    }
  },
  "viewer_context": {
    "liked": false,
    "recasted": false
  }
}