Skip to content

Commit f1026d5

Browse files
feat(api): update via SDK Studio
1 parent e444c1c commit f1026d5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { Status, StatusGetStatusParams, StatusGetStatusResponse } from './resour
4545

4646
export interface ClientOptions {
4747
/**
48-
* Bearer token for accessing authenticated resources
48+
* API Key for accessing the ZeroEntropy API.
4949
*/
5050
bearerToken?: string | undefined;
5151

@@ -117,7 +117,7 @@ export class Zeroentropy extends Core.APIClient {
117117
/**
118118
* API Client for interfacing with the Zeroentropy API.
119119
*
120-
* @param {string | undefined} [opts.bearerToken=process.env['ZERO_ENTROPY_BEARER_TOKEN'] ?? undefined]
120+
* @param {string | undefined} [opts.bearerToken=process.env['ZEROENTROPY_API_KEY'] ?? undefined]
121121
* @param {string} [opts.baseURL=process.env['ZEROENTROPY_BASE_URL'] ?? https://api.zeroentropy.dev/v1] - Override the default base URL for the API.
122122
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
123123
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
@@ -128,12 +128,12 @@ export class Zeroentropy extends Core.APIClient {
128128
*/
129129
constructor({
130130
baseURL = Core.readEnv('ZEROENTROPY_BASE_URL'),
131-
bearerToken = Core.readEnv('ZERO_ENTROPY_BEARER_TOKEN'),
131+
bearerToken = Core.readEnv('ZEROENTROPY_API_KEY'),
132132
...opts
133133
}: ClientOptions = {}) {
134134
if (bearerToken === undefined) {
135135
throw new Errors.ZeroentropyError(
136-
"The ZERO_ENTROPY_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Zeroentropy client with an bearerToken option, like new Zeroentropy({ bearerToken: 'My Bearer Token' }).",
136+
"The ZEROENTROPY_API_KEY environment variable is missing or empty; either provide it, or instantiate the Zeroentropy client with an bearerToken option, like new Zeroentropy({ bearerToken: 'My Bearer Token' }).",
137137
);
138138
}
139139

tests/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ describe('instantiate client', () => {
195195

196196
test('with environment variable arguments', () => {
197197
// set options via env var
198-
process.env['ZERO_ENTROPY_BEARER_TOKEN'] = 'My Bearer Token';
198+
process.env['ZEROENTROPY_API_KEY'] = 'My Bearer Token';
199199
const client = new Zeroentropy();
200200
expect(client.bearerToken).toBe('My Bearer Token');
201201
});
202202

203203
test('with overridden environment variable arguments', () => {
204204
// set options via env var
205-
process.env['ZERO_ENTROPY_BEARER_TOKEN'] = 'another My Bearer Token';
205+
process.env['ZEROENTROPY_API_KEY'] = 'another My Bearer Token';
206206
const client = new Zeroentropy({ bearerToken: 'My Bearer Token' });
207207
expect(client.bearerToken).toBe('My Bearer Token');
208208
});

0 commit comments

Comments
 (0)