Widget
Display tracking information on your website
Last updated 12 Aug 2024
To make it easy for you to help your customers track their shipments, we have created a widget that you can embed on your website.
InfoThe widget is currently in beta and may be subject to changes in the future.
Implementation
1. Add the helper script to your website
To use the widget, you need to add the following script to your website. This script will handle the communication between the widget and your website.
<script src="https://tracking-widget.skrym.com/client-script.js" defer></script>
2. Get the URL for the widget
The widget is meant to be implemented as an iframe on your website. To get the URL to use for the iframe, you will first need to make a request to the following API.
WarningYou need to be authenticated with your API key to use this endpoint. To avoid exposing your API key to the public, please ensure that you make this request from your backend and not the client's browser.
This URL will include the necessary authentication to display the tracking information in the widget. The authenticated session is valid for 24 hours, after which a new widget URL is needed.
3. Embed the widget on your website
Once you have the URL, you can embed the widget on your website using an iframe.
<iframe src="URL_FROM_API" id="skrym-tracking-widget"></iframe>
With the script added above, the iframe will be automatically resized to fit the content of the widget. All you need to do is to set the width as you desire, and the height will be adjusted dynamically.
TipBy default, an iframe has a border around it. This can easily be removed by setting the CSS property
border
tonone
.If you still want a border on the iframe, you can style it as you like using CSS. However, please ensure that the
box-sizing
CSS property is set tocontent-box
, as it might otherwise break the auto-height functionality of the widget.
Configuration
To get the widget to look and work as you want it, there are a few configuration options available. To learn more, see the configuration docs.
Pages in this folder