mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-13 05:07:51 +02:00
feat(sdk-js): add apiKey property
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
|
||||
interface ClientConfig {
|
||||
apiUrl?: string;
|
||||
apiKey?: string;
|
||||
callerOptions?: AsyncCallerParams;
|
||||
timeoutMs?: number;
|
||||
defaultHeaders?: Record<string, string | null | undefined>;
|
||||
@@ -48,6 +49,9 @@ class BaseClient {
|
||||
this.timeoutMs = config?.timeoutMs || 12_000;
|
||||
this.apiUrl = config?.apiUrl || "http://localhost:8123";
|
||||
this.defaultHeaders = config?.defaultHeaders || {};
|
||||
if (config?.apiKey != null) {
|
||||
this.defaultHeaders["X-Api-Key"] = config.apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
protected prepareFetchOptions(
|
||||
|
||||
Reference in New Issue
Block a user