import { NeynarAPIClient, isApiErrorResponse } from "@neynar/nodejs-sdk";import { AxiosError } from "axios";
Instantiate the client
Copy
Ask AI
const client = new NeynarAPIClient("API_KEY");
Call fetchAllNotifications function to get feed
Copy
Ask AI
(async () => { try { const cast = await client.fetchAllNotifications(194, { limit: 1, // change to however many notifications you want to get at once (max 50) }); console.log(JSON.stringify(cast)); } catch (error) { // isApiErrorResponse can be used to check for Neynar API errors // handle errors accordingly if (isApiErrorResponse(error)) { console.log("API Error", error.response.data); } else { console.log("Generic Error", error); } }})();
You can use this to show a notification on your client! You get all the data in one request, making it easy to display or use in your next operation. If you want to try getting a live response, head over to our API page for v2/feed.You can take the cursor from the output and pass it in the next request to the SDK to page to the next set of results.