import type { SSRInitialData } from 'c15t'; import type { FetchSSRDataOptions } from './types'; /** * Fetches initial consent data on the server for SSR hydration. * * @remarks * This is the framework-agnostic SSR data fetching function. It accepts * a standard Web API Headers object and performs the fetch to the c15t backend. * * Framework-specific packages (like @c15t/nextjs) wrap this function * with their own header resolution logic. * * **Usage in Framework Wrappers:** * ```ts * // @c15t/nextjs * import { headers } from 'next/headers'; * import { fetchSSRData } from '@c15t/react/server'; * * export async function fetchInitialData(options) { * const nextHeaders = await headers(); * return fetchSSRData({ ...options, headers: nextHeaders }); * } * ``` * * **Direct Usage (advanced):** * ```ts * // In any framework with access to request headers * import { fetchSSRData } from '@c15t/react/server'; * * const data = await fetchSSRData({ * backendURL: '/api/consent', * headers: request.headers, * debug: true * }); * ``` * * @param options - Configuration options including backendURL, headers, overrides, and debug * @returns The SSR initial data or undefined if the fetch fails * * @public */ export declare function fetchSSRData(options: FetchSSRDataOptions): Promise;