Skip to content

Commit

Permalink
Merge pull request #34 from neynarxyz/feature/neynar-v2-client
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
Shreyaschorge authored Nov 9, 2023
2 parents 4f3f5e8 + 18cea62 commit 8542b1e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# nodejs-sdk
# [@neynar/nodejs-sdk](https://www.npmjs.com/package/@neynar/nodejs-sdk)

@neynar/nodejs-sdk typescript-based, easy to use sdk built to interact with [Neynar API's](https://docs.neynar.com/).

## Instantiate Client

Just set the NEYNAR_API_KEY while instantiating a client and you are good to go.

```
import { NeynarAPIClient } from "@neynar/nodejs-sdk";
const neynarClient = new NeynarAPIClient(process.env.NEYNAR_API_KEY);
export default neynarClient;
```

## Use Client

Errors are propagated, so the user can handle them as they please, so use try/catch or .catch() and handle erros accordingly

```
try {
const recentCasts = await neynarClient.fetchRecentCasts();
console.log("Cast published successfully");
} catch (error) {
console.log((error as AxiosError).response?.data || (error as Error));
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neynar/nodejs-sdk",
"version": "0.10.5",
"version": "0.10.6",
"description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand Down

0 comments on commit 8542b1e

Please sign in to comment.