Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ffflorian/api-client

ffflorian11GPL-3.01.0.13TypeScript support: included

A generic API client

api, api-client

readme

api-client npm version

A generic API client.

Installation

Run yarn add @ffflorian/api-client or npm install @ffflorian/api-client.

Usage

A complete documentation is available at https://ffflorian.github.io/api-clients/packages/api-client/.

Examples

import {APIClient} from '@ffflorian/api-client';

const apiClient = new APIClient('https://example.com/api/v1');

apiClient.requestService
  .get('/endpoint', {
    headers: {
      Authorization: 'my-api-key',
    },
  })
  .then(data => {
    // ...
  });
import {APIClient} from '@ffflorian/api-client';

const apiClient = new APIClient({
  apiUrl: 'https://example.com/api/v1',
  requestInjector: config => {
    const hawkHeader = hawk.client.header(config.url, config.method, {credentials});
    return {
      ...config,
      headers: {
        Authorization: hawkHeader.header,
      },
    };
  },
});

apiClient.requestService.get('/endpoint').then(data => {
  // ...
});

Build

yarn
yarn dist

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.13 (2020-06-24)

Note: Version bump only for package @ffflorian/api-client

1.0.12 (2020-05-24)

Note: Version bump only for package @ffflorian/api-client

1.0.11 (2020-05-13)

Note: Version bump only for package @ffflorian/api-client

1.0.10 (2020-04-27)

Note: Version bump only for package @ffflorian/api-client

1.0.9 (2020-04-26)

Note: Version bump only for package @ffflorian/api-client

1.0.8 (2020-02-13)

Note: Version bump only for package @ffflorian/api-client

1.0.7 (2020-01-22)

Note: Version bump only for package @ffflorian/api-client

1.0.6 (2020-01-17)

Note: Version bump only for package @ffflorian/api-client

1.0.5 (2020-01-16)

Note: Version bump only for package @ffflorian/api-client

1.0.4 (2020-01-15)

Note: Version bump only for package @ffflorian/api-client

1.0.3 (2019-12-18)

Note: Version bump only for package @ffflorian/api-client

1.0.2 (2019-09-11)

Note: Version bump only for package @ffflorian/api-client

1.0.1 (2019-09-01)

Note: Version bump only for package @ffflorian/api-client

1.0.0 (2019-07-17)

Features

  • Set ES6 as target and require Node >= 10.9 (#130) (42109dc)

BREAKING CHANGES

  • Node.js >= 10.9 is required.

0.5.1 (2019-07-11)

Note: Version bump only for package @ffflorian/api-client

0.5.0 (2019-06-09)

Features

  • updown.io: Use @ffflorian/api-client (#98) (a6be424)

0.4.4 (2019-05-30)

Bug Fixes

  • security: Upgrade axios to 0.19.0 (b745299)

0.4.3 (2019-05-14)

Note: Version bump only for package @ffflorian/api-client

0.4.2 (2019-04-11)

Note: Version bump only for package @ffflorian/api-client

0.4.1 (2019-04-11)

Note: Version bump only for package @ffflorian/api-client

0.4.0 (2019-04-11)

Features

  • api-client: Add/remove a requestInjector (#46) (79b53e0)

0.3.4 (2019-04-05)

Note: Version bump only for package @ffflorian/api-client

0.3.3 (2019-04-05)

Note: Version bump only for package @ffflorian/api-client

0.3.2 (2019-04-03)

Note: Version bump only for package @ffflorian/api-client

0.3.1 (2019-03-31)

Note: Version bump only for package @ffflorian/api-client

0.3.0 (2019-03-27)

Features

  • api-client: Add ability to send data (#30) (318830b)

0.2.0 (2019-03-20)

Features

0.1.0 (2019-03-09)

Features