The Selz JavaScript SDK is a lightweight library to allow you to build ecommerce into any web application. You can query for product information and manage shopping carts.

It is assumed you have reasonable knowledge of JavaScript to use this library.

Getting started

Using Yarn:

yarn add selz-js-sdk

Using npm:

npm install selz-js-sdk

or using our CDN:

<script src="https://sdk.selzstatic.com/1.0.3/client.js"></script>

Polyfilling

The SDK is built using ES6 and ES7 syntax, meaning if you need to support older browsers such as IE11, you will need to add polyfills to support them. The two recommended options are:

polyfill.io

polyfill.io is a service that will serve polyfills based on the User Agent header so only browsers that require polyfills will get them.

babel-polyfill / core-js

You can include babel-polyfill or core-js to add the required polyfills to your build combined with babel-preset-env to only include the polyfills required for your targetted browsers.

Creating a client

If you're using the module then you'll need to import the client

import Client from 'selz-js-sdk';
const client = new Client({
    store: 12345,
});

Options

Property Type Default Required Description
store Number or String -1 Yes ยน The store ID (e.g. 123456 ) or a URL in the store (e.g. store.selz.com or mystore.com or selz.co/1a2b3c ).
  1. A store ID is preferred and is faster.

Licensed under the MIT

License text