Skip to content
This repository was archived by the owner on Jun 14, 2023. It is now read-only.

smatch-corp/http-client

Repository files navigation

@smatch-corp/http-client

Highly subjectively customized HTTP client library based on Ky.

Installation

# THIS IS NOT PUBLISEHD ON PUBLIC NPM REGISTRY.
yarn add @smatch-corp/http-client

Usage

const api = createHttpClient(env.baseUrl, {
  logging: true,
  refresh: async (request, next) => {
    const refreshedAccessToken = await doSomething()
    request.headers.set('Authorization', `Bearer ${refreshedAccessToken}`);

    next(request);
  }
  // ... Ky options
});

api.post(/* ... */);

About

Highly subjectively customized HTTP client library based on Ky.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published