Create an API Test
Choose your API test type
Set up an API test
5
Write your variant code

// Check if Shoplift is available, then trigger the test
if (window.shoplift) {
const isActive = await window.shoplift.isHypothesisActive('YOUR_HYPOTHESIS_ID');
if (isActive) {
// Variant code runs here — or Shoplift executes the variant
// script you wrote in the Shoplift editor
}
}Tips for a successful API test
Last updated
Was this helpful?


