RestClientConfig
Defined in: clients/http-client/src/rest-client.ts:8
Settings for createRestClient.
Properties
Section titled “Properties”apiKeyHeader?
Section titled “apiKeyHeader?”
optionalapiKeyHeader?:string
Defined in: clients/http-client/src/rest-client.ts:21
Header name when tokenScheme is "apikey". Defaults to "x-api-key".
baseUrl
Section titled “baseUrl”baseUrl:
string
Defined in: clients/http-client/src/rest-client.ts:10
Default base URL (e.g. “https://api.github.com”).
defaultQuery?
Section titled “defaultQuery?”
optionaldefaultQuery?:Record<string,string>
Defined in: clients/http-client/src/rest-client.ts:28
Query params appended to every request URL (e.g. Vercel’s teamId).
errors?
Section titled “errors?”
optionalerrors?:ErrorSink
Defined in: clients/http-client/src/rest-client.ts:46
Reports transport failures (network errors, status: 0) and unexpected
5xx responses. 4xx is left unreported — those are typically expected /
handled by the caller (a 404 from a “does this exist” check, etc.).
Defaults to a no-op.
extraHeaders?
Section titled “extraHeaders?”
optionalextraHeaders?:Record<string,string>
Defined in: clients/http-client/src/rest-client.ts:26
Static headers merged into every request. Applied after the auth header
so they can override defaults (e.g. GitHub’s accept override).
fetch?
Section titled “fetch?”
optionalfetch?: (input,init?) =>Promise<Response>
Defined in: clients/http-client/src/rest-client.ts:32
Override fetch for tests. Defaults to globalThis.fetch.
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
logger?
Section titled “logger?”
optionallogger?:Logger
Defined in: clients/http-client/src/rest-client.ts:39
Structured logger for request/response diagnostics (debug level).
Defaults to a no-op — the seam, not a runtime. Bring your own
@theholocron/observability Logger (or any structurally-compatible
one) to see it.
retries?
Section titled “retries?”
optionalretries?:number
Defined in: clients/http-client/src/rest-client.ts:52
How many times to send a request again after a transport failure that is safe to repeat (see worthRetrying):
the connection never opened, or a read was dropped. An HTTP error status is retried only when it is listed in
retryStatuses. Defaults to 2; 0 turns it off.
retryDelayMs?
Section titled “retryDelayMs?”
optionalretryDelayMs?:number
Defined in: clients/http-client/src/rest-client.ts:54
Milliseconds before the first retry; each later one waits three times as long. Defaults to 300.
retryStatuses?
Section titled “retryStatuses?”
optionalretryStatuses?: readonlynumber[]
Defined in: clients/http-client/src/rest-client.ts:60
HTTP statuses (for example [500, 502, 503, 504]) that are worth asking for again, using the same retries
and retryDelayMs. Only a read (GET or HEAD) is repeated; a write is never sent again on a status, because the
server may have applied it. Defaults to none, so a client that does not ask behaves as before.
token:
string
Defined in: clients/http-client/src/rest-client.ts:12
Auth token.
tokenScheme?
Section titled “tokenScheme?”
optionaltokenScheme?:"bearer"|"basic"|"apikey"
Defined in: clients/http-client/src/rest-client.ts:19
How the token is sent.
"bearer"(default):Authorization: Bearer <token>"basic":Authorization: Basic <token>"apikey": usesapiKeyHeader(e.g.x-api-key)
vendor?
Section titled “vendor?”
optionalvendor?:string
Defined in: clients/http-client/src/rest-client.ts:30
Vendor label used in error messages (e.g. "GitHub").