Skip to main content
All options are optional.

Options (ReyGridConfig)

RequestContext is { method: string; url: string; authenticated: boolean }. The SDK sets Accept and Content-Type to application/json unless you override them in headers. The constructor throws if no fetch is available (Node.js earlier than 18 without a fetch option).

Custom base URL

Custom fetch

Logging errors with onError

onError is called for network failures and API errors from regular requests. It is not called for errors raised while streaming with streamChat().

Timeouts

timeoutMs aborts the request when it elapses. For streamChat() it covers the entire stream, so raise it for long responses.

Low-level requests

client.request<T>(path, init?) is public and sends an authenticated request relative to baseUrl. Prefer the typed methods.