Class Client<Context>

Type Parameters

  • Context extends ByuClientExecutionContext = ByuClientExecutionContext

Hierarchy (view full)

Constructors

Properties

Shares information and functionality between middlewares. For example, the default middleware execution context always includes a Pino logger instance.

credentials?: CredentialProvider

Expose the credential provider as readonly so developers can interact with it.

logger: Logger

A logger library compatible with Pino for logging in middleware layers.

Expose the middleware stack as readonly so developers can add additional middleware for a specific client.

prefix: string

Expose the prefix for other extensions to match with.

Methods

  • fetch is a wrapper around the send method, instantiating a FetchCommand and then invoking the send method.

    Parameters

    • url: string | URL | Request
    • Optional options: RequestInit

    Returns Promise<Response>

  • A convenience accessor for obtaining the issuer URL from an oauth credential provider. The accessor will throw without properly instantiating an oauth credential provider.

    Returns Promise<URL>

  • Enchains the middleware stack executes the asynchronous operation

    Type Parameters

    • I extends object
    • O extends object

    Parameters

    Returns Promise<O>

    The fully deserialized value.

  • A function that ends the middleware callback chain by executing fetch request and returning the response.

    between middlewares.

    Parameters

    • this: undefined

    Returns FinalizeHandler<object, object>

    A fetch Response object.