Embedding the SDK
Using the Variant Javascript SDK on your webpage or e-commerce site
The Variant JS SDK is used to generate links to product variations. Though you can use universal links to products (see Universal Links documentation), using the SDK will deliver the best UX when the user is already on a webpage.

Getting Started

Importing
1
<script async src="https://sdk.variant.app/js/variant.min.1.0.js?v=1.0.5">
2
</script>
Copied!
Initialising
Note: Your api key can be found on your Dashboard, or in your Team details.
1
var settings = { apiKey: YOUR_API_KEY };
2
Variant.init(settings);
Copied!
Last modified 6mo ago
Copy link