Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClientConfig<Params>

Configuration parameters common to Commerce SDK clients

Type parameters

Hierarchy

  • ClientConfig

Implements

Index

Constructors

constructor

Properties

Optional baseUri

baseUri: undefined | string

fetchOptions

fetchOptions: FetchOptions

headers

headers: {}

Type declaration

  • [key: string]: string

parameters

parameters: Params

Optional proxy

proxy: undefined | string

throwOnBadResponse

throwOnBadResponse: boolean

transformRequest

transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>

Object literals

Static Readonly defaults

defaults: object

transformRequest

  • transformRequest(data: unknown, headers: {}): string | ArrayBuffer | ArrayBufferView | URLSearchParams | (ReadableStream & ReadableStream<any>) | (ReadableStream & Blob) | (ReadableStream & FormData) | (FormData & ReadableStream<any>) | (FormData & Blob) | (FormData & FormData)
  • If the Content-Type header is application/json, the data is converted to a JSON string. If the Content-Type header is application/x-www-form-urlencoded, the data is converted to a URLSearchParams object. In all other cases, the data is returned unmodified.

    Parameters

    • data: unknown

      Data to transform

    • headers: {}
      • [key: string]: string

    Returns string | ArrayBuffer | ArrayBufferView | URLSearchParams | (ReadableStream & ReadableStream<any>) | (ReadableStream & Blob) | (ReadableStream & FormData) | (FormData & ReadableStream<any>) | (FormData & Blob) | (FormData & FormData)

    A payload appropriate for the specified Content-Type header

Generated using TypeDoc