Merge pull request #2071 from K-Mistele/main

Add ability to set API key for JS client
This commit is contained in:
emrgnt-cmplxty
2025-03-20 19:35:37 -07:00
committed by GitHub
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -1,8 +1,8 @@
import axios, {
AxiosInstance,
Method,
AxiosResponse,
AxiosRequestConfig,
AxiosResponse,
Method,
} from "axios";
import FormData from "form-data";
import { ensureCamelCase } from "./utils";
@@ -239,4 +239,9 @@ export abstract class BaseClient {
this.accessToken = accessToken;
this.refreshToken = refreshToken;
}
setApiKey(apiKey: string): void {
if (!apiKey) throw new Error("API key is required");
this.apiKey = apiKey;
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import axios, { Method, AxiosError } from "axios";
import axios, { AxiosError, Method } from "axios";
import { BaseClient } from "./baseClient";
import { ChunksClient } from "./v3/clients/chunks";