Skip to content

Commit b15cb05

Browse files
committed
Make OAuth client optional
1 parent 23e75e5 commit b15cb05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/sdk/src/server/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class ServerClient {
289289
environment?: string;
290290
secretKey: string;
291291
publicKey: string;
292-
oauthClient: ClientCredentials;
292+
oauthClient?: ClientCredentials;
293293
oauthToken?: AccessToken;
294294
baseURL: string;
295295

@@ -344,6 +344,10 @@ class ServerClient {
344344
}
345345

346346
async _oauthAuthorizationHeader(): Promise<string> {
347+
if (!this.oauthClient) {
348+
throw new Error("OAuth client not configured");
349+
}
350+
347351
if (!this.oauthToken || this.oauthToken.expired()) {
348352
this.oauthToken = await this.oauthClient.getToken({});
349353
}

0 commit comments

Comments
 (0)