Factory returning a deduplicated Axios client configured with base URL and optional auth.
// Source: https://github.com/FlowiseAI/Flowise | License: Apache-2.0 | Copyright 2023-present FlowiseAI, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import axios, { AxiosInstance } from 'axios'
import type { RequestInterceptor } from '@/core/types'
import { type DeduplicatedClient, withDeduplication } from './deduplicatedClient'
/**
* Creates a configured axios client for API calls
* @param apiBaseUrl - Base URL of the Flowise server
* @param token - Authentication token (optional)
* @param requestInterceptor - Optional callback to customize outgoing requests
*/
export function bindApiClient(apiBaseUrl: string, token?: string, requestInterceptor?: RequestInterceptor): DeduplicatedClient {
const headers: Record<string, string> = {
'Content-Type'
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key