Skip to content

Commit 2f93b89

Browse files
committed
fix: update privateAPIKey to privateKey in code and tests
1 parent 70c98e0 commit 2f93b89

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Generate a simple URL without any transformations:
101101
import ImageKit from '@imagekit/nodejs';
102102

103103
const client = new ImageKit({
104-
privateAPIKey: process.env['IMAGEKIT_PRIVATE_API_KEY'],
104+
privateKey: process.env['IMAGEKIT_PRIVATE_KEY'],
105105
password: process.env['ORG_MY_PASSWORD_TOKEN'],
106106
});
107107

src/resources/helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class Helper extends APIResource {
9898
const expiryTimestamp = getSignatureTimestamp(opts.expiresIn);
9999

100100
const urlSignature = getSignature({
101-
privateKey: this._client.privateAPIKey,
101+
privateKey: this._client.privateKey,
102102
url: finalUrl,
103103
urlEndpoint: opts.urlEndpoint,
104104
expiryTimestamp,
@@ -151,7 +151,7 @@ export class Helper extends APIResource {
151151
* @throws {Error} If the private API key is not configured (should not happen in normal usage)
152152
*/
153153
getAuthenticationParameters(token?: string, expire?: number) {
154-
if (!this._client.privateAPIKey) {
154+
if (!this._client.privateKey) {
155155
throw new Error('Private API key is required for authentication parameters generation');
156156
}
157157

@@ -161,7 +161,7 @@ export class Helper extends APIResource {
161161
const finalToken = token || uuid4();
162162
const finalExpire = expire || defaultExpire;
163163

164-
return getAuthenticationParameters(finalToken, finalExpire, this._client.privateAPIKey);
164+
return getAuthenticationParameters(finalToken, finalExpire, this._client.privateKey);
165165
}
166166
}
167167

tests/helper-authentication.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ImageKit from '@imagekit/nodejs';
22

33
const client = new ImageKit({
4-
privateAPIKey: 'private_key_test',
4+
privateKey: 'private_key_test',
55
password: 'My Password',
66
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
77
});

tests/url-generation/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ImageKit from '@imagekit/nodejs';
22
import type { SrcOptions } from '../../src/resources/shared';
33

44
const client = new ImageKit({
5-
privateAPIKey: 'My Private API Key',
5+
privateKey: 'My Private API Key',
66
password: 'My Password',
77
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
88
});

tests/url-generation/buildTransformationString.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ImageKit from '@imagekit/nodejs';
22
import type { Transformation } from '../../src/resources/shared';
33

44
const client = new ImageKit({
5-
privateAPIKey: 'My Private API Key',
5+
privateKey: 'My Private API Key',
66
password: 'My Password',
77
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
88
});

tests/url-generation/overlay.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ImageKit from '@imagekit/nodejs';
22
import { safeBtoa } from '../../src/lib/transformation-utils';
33

44
const client = new ImageKit({
5-
privateAPIKey: 'My Private API Key',
5+
privateKey: 'My Private API Key',
66
password: 'My Password',
77
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
88
});

tests/url-generation/signing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ImageKit from '@imagekit/nodejs';
88
* Ideally this code would not require any upkeeping.
99
*/
1010
const client = new ImageKit({
11-
privateAPIKey: 'dummy-key',
11+
privateKey: 'dummy-key',
1212
password: 'My Password',
1313
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
1414
});

0 commit comments

Comments
 (0)