@getevy/js-sdk

0.0.32 • Public • Published

Evy SDK

Evy SDK is a vanilla JS / TS library that provides widgets for your Evy integration.

Evy is not meant to be used directly with frameworks or UI libraries (eg. React/Vue.js/Angular/Ember...). Instead, you should use Evy stately.

Installation

npm i @getevy/js-sdk

Alternatively, you can link the library in your HTML page, like that:

<head>
  <script src="https://cdn.jsdelivr.net/npm/@getevy/js-sdk@latest/dist/bundle.js"></script>
  ...
</head>

Initialization

import { init as initEvySdk, components as evyComponents } from '@getevy/js-sdk';

const evySdk = initEvySdk({ apiKey: 'your_api_key' });

evySdk.addComponents([
  evyComponents.inlineOffer({
    container: '#inlineOffer-container',
    product: 'my-product-id',
  }),
]);

Configuration object

Key Required Description
apiKey yes your API key
apiURL no the URL of the API to target
operator no An object containing the nameand logoUrl of the operator

Components

cartOffer

Component to use in the cart to display the currently selected offer or add one there.

Parameters object

Key Required Description
container yes The selector of the container of the component (for example an empty div)
product yes The product ID

inlineOffer

Component to use in a product description page.

Parameters object

Key Required Description
container yes The selector of the container of the component (for example an empty div)
product yes The product ID

modalOffer

A variation of the inline offer with a modal.

Parameters object

Key Required Description
product yes The product ID
modalType no The placement of the modal. Can be either left, right. center. Defaults to center

Readme

Keywords

Package Sidebar

Install

npm i @getevy/js-sdk

Weekly Downloads

6

Version

0.0.32

License

MIT

Unpacked Size

1.46 MB

Total Files

26

Last publish

Collaborators

  • bobylito
  • emilyevy
  • kseniia_evy
  • shana-evy