@getevy/api-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.32 • Public • Published

JS Evy API Client

An extended JS/TS client for Evy API.

Works in browsers and node.

Add the dependency to your project

npm i @getevy/api-client

Initialization

import EvyApi from '@getevy/api-client';
const apiClient = new EvyApi({ apiKey: 'your_api_key' });

Configuration object

Key Required Description
apiKey yes your API key
apiURL no the URL of the API to target
language no the prefered language of the user, only en and fr are supported for now

Usage

Get offers

Usage

const offers = await apiClient.offers.get('product_id', 1000, 'en');

Interface

apiClient.offers.get(product_id: string, price: number, language?: string) => Promise<IOffersData>

Parameters (from left to right)

Name Required Description
product_id yes The product for which we want insurance offers
price yes The current price of the product
language no The locale (overrides the initial configuration)

Result: IOffersData

Key Description
offers The offers attachable on the product
locales The translations of the wording to use with the offer

See the types or the API documentation for further descriptions.

License

The MIT License (MIT). Please see the License File for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @getevy/api-client

Weekly Downloads

1

Version

0.0.32

License

MIT

Unpacked Size

80.6 kB

Total Files

34

Last publish

Collaborators

  • bobylito
  • emilyevy
  • kseniia_evy
  • shana-evy