Skip to content

SDK

The Sprii SDK makes it possible to

  • Support checkout from social media, directly on your site
  • Embed live shopping on your own website, including Show galleries, clips and much more
  • Hydrate live shop products with customer specific prices

We have 2 different versions you can include on your site:

  • Checkout only
    • This version is if you only want to support social media live shopping
  • Widget version
    • This version includes all gallery features and onsite player

The URL for the script you should use is available in the Sprii admin.

Basic example

Below is a basic example of setting up the script:

html
<head>
  <script>
   window.onSpriiReady = (sdk) => {
    //Change settings, add events and so on
    const someCheckoutHandler = async (payload) => {
      // your add to cart logic
      console.log(payload);
      return {status: 'SUCCESS'}
    };
    const cartOpenedEventHandler = async (payload) => {
      // your event tracking logic */
      console.log(payload);
    };
    sdk.registerAction(sdk.actions.SOME_CHECKOUT, someCheckoutHandler);
    sdk.on(sdk.events.CART_OPEN, cartOpenedEventHandler);
  };
  </script>
  <script src="https://widget.cdn.sprii.shop/sprii-checkout.js">
</head>

Next steps?

Now that we have the basics in place, it is time to look at the cookbooks to finf out what actions you need to implement for your usecase