Skip to main content
Version: v8.0.0

ClientOptionsType

Configuration setup for the client


Import
import { ClientOptionsType } from "@hyper-fetch/core"

Preview

type ClientOptionsType<C> = {
appManager?: () => C[appManager];
cache?: () => C[cache];
fetchDispatcher?: () => C[submitDispatcher];
mode?: ClientModeOption;
submitDispatcher?: () => C[fetchDispatcher];
url: string;
}

Structure

ClientOptionsType
NameTypeDescription
mode
ClientModeOption

How the effective ClientMode is chosen for cache behavior.

&quot;auto&quot; (default when omitted): browser → &quot;client&quot; , otherwise &quot;server&quot; .

&quot;client&quot; / &quot;server&quot; : force that mode regardless of environment (tests, SSR overrides, etc.).

url
string

Url to your server

appManager
() => C[appManager]

Custom app manager initialization prop

cache
() => C[cache]

Custom cache initialization prop

fetchDispatcher
() => C[submitDispatcher]

Custom fetch dispatcher initialization prop

submitDispatcher
() => C[fetchDispatcher]

Custom submit dispatcher initialization prop