diff --git a/libs/sdk-js/src/index.ts b/libs/sdk-js/src/index.ts index 764abbc67..823476249 100644 --- a/libs/sdk-js/src/index.ts +++ b/libs/sdk-js/src/index.ts @@ -17,5 +17,6 @@ export type { Checkpoint, Interrupt, } from "./schema.js"; +export { overrideFetchImplementation } from "./singletons/fetch.js"; export type { OnConflictBehavior, Command } from "./types.js"; diff --git a/libs/sdk-js/src/singletons/fetch.ts b/libs/sdk-js/src/singletons/fetch.ts index ce4a84ece..8ed71b000 100644 --- a/libs/sdk-js/src/singletons/fetch.ts +++ b/libs/sdk-js/src/singletons/fetch.ts @@ -5,14 +5,14 @@ const DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args); const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for( - "ls:fetch_implementation", + "lg:fetch_implementation", ); /** * Overrides the fetch implementation used for LangSmith calls. * You should use this if you need to use an implementation of fetch * other than the default global (e.g. for dealing with proxies). - * @param fetch The new fetch functino to use. + * @param fetch The new fetch function to use. */ export const overrideFetchImplementation = (fetch: (...args: any[]) => any) => { (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;