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.
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>
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 is a service that will serve polyfills based on the User Agent header so only browsers that require polyfills will get them.
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.
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,
});
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 ). |