Skip to content

ClientOptions

Settings for a PostcodeClient. Each one is optional.

readonly optional apiKey?: string

The key for the X-API-Key header. With no key, the client sends no header.


readonly optional baseUrl?: string

The gateway’s address. The default is https://api.postcode.gov.ng.


readonly optional cacheTtlMs?: number

How long the client keeps a result, in milliseconds. The default 0 turns the cache off.


readonly optional maxRetries?: number

The most retries after the first attempt. The default is 2.


readonly optional timeoutMs?: number

The longest wait for one attempt, in milliseconds. The default is 8000, and 15000 for autocomplete.


readonly optional transport?: (input, init?) => Promise<Response>

The function that sends each request. The default is the platform’s fetch.

string | URL | Request

RequestInit

Promise<Response>

Unofficial. Not made or endorsed by NIPOST.