☰ Core / Configuration
Docs / Core
Configuration
Everything new ZpiClient(options) accepts:
| Option | Type | Default | Purpose |
|---|---|---|---|
| apiKey | string | — (required) | Your Zapi key; sent as x-api-key. Constructor throws if missing. |
| baseURL | string | https://api.zapi.ink | API origin override (staging, self-hosted). |
| defaultHeaders | Record<string, string> | {} | Extra headers merged into every request. |
| fetch | typeof fetch | global fetch | Injectable fetch implementation (polyfill, instrumentation). |
| timeoutMs | number | 30000 | Per-request timeout. |
| maxRetries | number | 2 | Max retry attempts for retryable failures. |
| baseRetryDelayMs | number | 200 | Exponential-backoff base delay. |
apiKey
Type: string
Default: — (required)
Purpose: Your Zapi key; sent as x-api-key. Constructor throws if missing.
baseURL
Type: string
Default: https://api.zapi.ink
Purpose: API origin override (staging, self-hosted).
defaultHeaders
Type: Record<string, string>
Default: {}
Purpose: Extra headers merged into every request.
fetch
Type: typeof fetch
Default: global fetch
Purpose: Injectable fetch implementation (polyfill, instrumentation).
timeoutMs
Type: number
Default: 30000
Purpose: Per-request timeout.
maxRetries
Type: number
Default: 2
Purpose: Max retry attempts for retryable failures.
baseRetryDelayMs
Type: number
Default: 200
Purpose: Exponential-backoff base delay.
Edit this page on GitHubWas this page helpful? ·
Docs menu