@nhost/nhost-js
Version:
Nhost JavaScript SDK
23 lines • 935 B
TypeScript
/**
* Headers middleware for the Nhost SDK.
*
* This module provides middleware functionality to automatically attach
* default headers to all outgoing requests, while allowing request-specific
* headers to take precedence.
*/
import type { ChainFunction } from './fetch';
/**
* Creates a fetch middleware that attaches default headers to requests.
*
* This middleware:
* 1. Merges default headers with request-specific headers
* 2. Preserves request-specific headers when they conflict with defaults
*
* The middleware ensures consistent headers across requests while allowing
* individual requests to override defaults as needed.
*
* @param defaultHeaders - Default headers to attach to all requests
* @returns A middleware function that can be used in the fetch chain
*/
export declare const withHeadersMiddleware: (defaultHeaders: HeadersInit) => ChainFunction;
//# sourceMappingURL=middlewareWithHeaders.d.ts.map