diff --git a/package.json b/package.json index 59203c0d..1ccdd84e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "0.10.9", + "version": "0.10.10", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 670520d2..88c11714 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -57,9 +57,14 @@ export class NeynarAPIClient { constructor( apiKey: string, { + basePath, logger = silentLogger, axiosInstance, - }: { logger?: Logger; axiosInstance?: AxiosInstance } = {} + }: { + basePath?: string; + logger?: Logger; + axiosInstance?: AxiosInstance; + } = {} ) { this.logger = logger; @@ -70,8 +75,8 @@ export class NeynarAPIClient { } this.clients = { - v1: new NeynarV1APIClient(apiKey, { logger, axiosInstance }), - v2: new NeynarV2APIClient(apiKey, { logger, axiosInstance }), + v1: new NeynarV1APIClient(apiKey, { basePath, logger, axiosInstance }), + v2: new NeynarV2APIClient(apiKey, { basePath, logger, axiosInstance }), }; } diff --git a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts b/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts index 9c2b8675..20fc0fdb 100644 --- a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts +++ b/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts @@ -48,9 +48,14 @@ export class NeynarV1APIClient { constructor( apiKey: string, { + basePath, logger = silentLogger, axiosInstance, - }: { logger?: Logger; axiosInstance?: AxiosInstance } = {} + }: { + basePath?: string; + logger?: Logger; + axiosInstance?: AxiosInstance; + } = {} ) { this.logger = logger; @@ -76,7 +81,7 @@ export class NeynarV1APIClient { ); const config: Configuration = new Configuration({ - basePath: BASE_PATH, + basePath: basePath ?? BASE_PATH, apiKey: apiKey, }); this.apis = { diff --git a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts index a0183654..4aa092df 100644 --- a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts +++ b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts @@ -66,9 +66,14 @@ export class NeynarV2APIClient { constructor( apiKey: string, { + basePath, logger = silentLogger, axiosInstance, - }: { logger?: Logger; axiosInstance?: AxiosInstance } = {} + }: { + basePath?: string; + logger?: Logger; + axiosInstance?: AxiosInstance; + } = {} ) { this.logger = logger; @@ -94,7 +99,7 @@ export class NeynarV2APIClient { ); const config: Configuration = new Configuration({ - basePath: BASE_PATH, + basePath: basePath ?? BASE_PATH, apiKey: apiKey, }); this.apis = {