Skip to content

Commit 3af0266

Browse files
committed
fix(types): accept undefined for optional client options (#257)
1 parent 334edb6 commit 3af0266

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export interface ClientOptions {
1010
/**
1111
* Defaults to process.env['ANTHROPIC_API_KEY'].
1212
*/
13-
apiKey?: string | null;
13+
apiKey?: string | null | undefined;
1414

1515
/**
1616
* Defaults to process.env['ANTHROPIC_AUTH_TOKEN'].
1717
*/
18-
authToken?: string | null;
18+
authToken?: string | null | undefined;
1919

2020
/**
2121
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
@@ -84,8 +84,8 @@ export class Anthropic extends Core.APIClient {
8484
/**
8585
* API Client for interfacing with the Anthropic API.
8686
*
87-
* @param {string | null} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null]
88-
* @param {string | null} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]
87+
* @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null]
88+
* @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]
8989
* @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API.
9090
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
9191
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.

0 commit comments

Comments
 (0)