# JavaScript API Testing

Shoplift's JavaScript API enables you to create sophisticated A/B tests directly in your theme code, giving you complete control over test logic and visitor experiences.

{% hint style="info" %}
API tests require developer involvement. Most merchants will need their developer or agency to write the JavaScript and (for manual API tests) implement the trigger logic.
{% endhint %}

To learn more about API testing, explore the documentation below.

{% hint style="info" %}
This guide covers basic usage of the JavaScript API for API testing purposes. For a full API reference, see [Reference](/api-reference/reference/window.shoplift.md).
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Overview</td><td><a href="/files/6NlUsmV6ngRk4XReiY76">/files/6NlUsmV6ngRk4XReiY76</a></td><td><a href="/pages/JgiYma6oeuSgzqYtmqjD">/pages/JgiYma6oeuSgzqYtmqjD</a></td></tr><tr><td>Use Cases</td><td><a href="/files/k8HNdUYNd4iREC2vNdAq">/files/k8HNdUYNd4iREC2vNdAq</a></td><td><a href="/pages/ROM4SmnivJM3yLjg9KnO">/pages/ROM4SmnivJM3yLjg9KnO</a></td></tr><tr><td>Create an API Test</td><td><a href="/files/aTkxxTwYjQ7pCdRdGeRS">/files/aTkxxTwYjQ7pCdRdGeRS</a></td><td><a href="/pages/DfoGBMtJgVsz7bUAdXVH">/pages/DfoGBMtJgVsz7bUAdXVH</a></td></tr><tr><td>Previewing an API Test</td><td><a href="/files/cOQEF3gfXXWBFsQgb6f5">/files/cOQEF3gfXXWBFsQgb6f5</a></td><td><a href="/pages/6FLLgQkFF9XEny4GvnEg">/pages/6FLLgQkFF9XEny4GvnEg</a></td></tr><tr><td>Ending an API Test</td><td><a href="/files/pjhOdY8e6F3hghSfkIyS">/files/pjhOdY8e6F3hghSfkIyS</a></td><td><a href="/pages/WpOVY84lbWeP1y0RQj3G">/pages/WpOVY84lbWeP1y0RQj3G</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shoplift.ai/test/javascript-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
