Interface: HttpTransportFetchOptions
Interface: HttpTransportFetchOptions
Defined in: auth-server-ts/src/http/http-transport.ts:29
Default HttpTransport implementation — fetch-based.
Responsibilities:
- Build absolute URLs from
ResolvedConfig+ path. - JSON-encode bodies + decode responses (with
Content-Typeshaping for the OAuth client-credentials form-urlencoded edge case). - Auto-attach the bearer token when an access token is passed in.
- Inject
Idempotency-Keyon unsafe methods so safe retries hit the auth-server’s idempotency middleware idempotently. - Forward
X-App-Codefrom config. - Map non-2xx via
ErrorMapper; map network failure toNetworkException.
Picked fetch (not axios) because it’s universally available — Node 20+,
Bun, Deno, edge runtimes, the browser — and removes a runtime dep from
the core. Framework adapters can bring their own client (the NestJS
adapter ships AxiosHttpTransportAdapter that satisfies the legacy
HttpTransportPort).
Mirrors PHP’s Vendidit\AuthServer\Http\HttpTransport.
Properties
config
config:
ResolvedConfig
Defined in: auth-server-ts/src/http/http-transport.ts:30
fetch?
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: auth-server-ts/src/http/http-transport.ts:32
Inject a custom fetch (e.g. with retry/circuit-breaker). Defaults to global fetch.
Call Signature
(
input,init?):Promise<Response>
Parameters
input
RequestInfo | URL
init?
RequestInit
Returns
Promise<Response>
Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | Request | URL
init?
RequestInit
Returns
Promise<Response>
logger?
optionallogger?:LoggerPort
Defined in: auth-server-ts/src/http/http-transport.ts:33