Guides / Configuration
Configuration
GoliathClient constructor options — base URL, timeouts, retries, and custom fetch
Constructor options
const goliath = new GoliathClient({
apiKey, // required — gsk_... from Settings → API keys
baseUrl: 'https://server.goliathdata.com', // required — the API host
timeoutMs: 60_000, // optional — per-attempt timeout (default 60s)
maxRetries: 2, // optional — retry budget (default 2)
fetch: customFetch, // optional — inject for non-Node runtimes/tests
})
| Option | Required | Default | Notes |
|---|---|---|---|
apiKey |
yes | — | Server-to-server credential. Never ship it to a browser or mobile app. |
baseUrl |
yes | — | https://server.goliathdata.com for production. |
timeoutMs |
no | 60000 |
Applies per attempt, not per call — a retried call can take longer overall. |
maxRetries |
no | 2 |
Governs the retry policy described in Errors, retries & idempotency. |
fetch |
no | global fetch |
Inject a WHATWG-compatible implementation for edge runtimes or request capture in tests. The runtime still needs AbortSignal.any. |
Runtime requirements
Use Node.js 20.3 or later. The SDK relies on WHATWG fetch and
AbortSignal.any, introduced in Node 20.3; a custom fetch alone does not
supply the abort API. Keep the SDK server-side so the API key stays on your
servers.
The transport posts to /api/v1/graphql, the supported alias of
/api/v1/call, with the same { operationId, variables } body. Supply only
the host in baseUrl. For direct HTTP calls, prefer /api/v1/call.