Skip to main content

SDK

The Smartzer SDK is a simple javascript library, providing two web components that you can include on your site to embed a Smartzer project. It also provides listeners for handling Javascript events that are triggered by the Smartzer player.

Adding the SDK to your page

The first step to using the SDK is adding our script to your website. It must be loaded on the page where you plan to embed a Smartzer project. Include a script tag on the page where you want to render the Smartzer Interactive Player(s) with the following src URL:

<script src="https://scripts.smartzer.com/sdk/latest/embed.js"></script>

Render a project in the Smartzer Player

A Smartzer project can be embedded on a website in multiple ways:

  1. Custom Components - Use the smrtzr-project and smrtzr-playlist components to render a single project or playlist of projects respectively.
  2. Iframe - Use an iframe to embed a single project.

Custom Components require the SDK script to be loaded on the page, but for iframe it is optional, providing the ability to interact with a range of user and analytics events from within the player.

A basic example of an iframe embedding a Smartzer project combined with the SDK script is shown below:

  <iframe src="https://player.smartzer.com/{YOUR_PROJECT_TYPE}/{YOUR_PROJECT_TYPE}"></iframe>
<script src=https://scripts.smartzer.com/sdk/latest/embed.js></script>

Please see embedding for full guide through the different ways to embed a Smartzer project.

Handling events

Click here to read more about our listeners and how you can use them to interact with the Smartzer player.