Skip to content

Commit

Permalink
Restructure sdk
Browse files Browse the repository at this point in the history
 Restructure sdk
  • Loading branch information
Shreyaschorge authored Nov 28, 2023
2 parents c45e129 + 82072d1 commit 471cb50
Show file tree
Hide file tree
Showing 227 changed files with 8,876 additions and 8,594 deletions.
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
# @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";
@neynar/nodejs-sdk typescript-based, easy-to-use SDK built to interact with [Neynar API's](https://docs.neynar.com/).

const neynarClient = new NeynarAPIClient(process.env.NEYNAR_API_KEY);
## Usage

export default neynarClient;
```
Please refer our [Getting Started Guide](https://docs.neynar.com/reference/getting-started-with-sdk)

## Use Client
Checkout [examples](https://github.com/neynarxyz/farcaster-examples) using this SDK

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

```
try {
const recentCasts = await neynarClient.fetchRecentCasts();
console.log("Recent Casts", recentCasts);
} catch (error) {
console.log((error as AxiosError).response?.data || (error as Error));
}
```
This project is licensed under the MIT License - see the [LICENSE](https://github.com/neynarxyz/nodejs-sdk/blob/main/LICENSE) file for details.
116 changes: 0 additions & 116 deletions docs/getting-started.md

This file was deleted.

2 changes: 1 addition & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.0.1"
"version": "6.6.0"
}
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neynar/nodejs-sdk",
"version": "0.11.4",
"version": "1.0.0",
"description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand All @@ -10,12 +10,12 @@
"scripts": {
"clean": "del-cli ./build/*",
"build": "yarn run clean && tsc",
"generate:neynar-oas": "openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-farcaster": "openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-farcaster --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-recommendation": "openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-recommendation --config src/oas/openapi-generator-config.json"
"generate:neynar-oas-v1-farcaster": "del-cli src/neynar-api/v1/openapi; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/v1/openapi --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-farcaster": "del-cli src/neynar-api/v2/openapi-farcaster; openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-farcaster --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-recommendation": "del-cli src/neynar-api/v2/openapi-recommendation; openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-recommendation --config src/oas/openapi-generator-config.json"
},
"author": "Neynar",
"license": "ISC",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.8.4",
"del-cli": "^5.1.0",
Expand All @@ -24,6 +24,7 @@
},
"dependencies": {
"@openapitools/openapi-generator-cli": "^2.7.0",
"axios": "^1.6.2"
"axios": "^1.6.2",
"viem": "^1.19.9"
}
}
}
Loading

0 comments on commit 471cb50

Please sign in to comment.