Skip to content

SDK Installation

Add this to your HTML, before the closing </body> tag:

<script
src="https://appbe.endlesstesting.ai/api/sdk.js"
data-base="https://appbe.endlesstesting.ai"
async
></script>

The endlesstesting init CLI command outputs this snippet with your configuration.

  1. SDK loads and calls the allocation API for the current page URL
  2. Thompson sampling selects the best variant for each running test
  3. DOM changes are applied (text swaps, element modifications)
  4. Impressions are tracked automatically
  5. Clicks and conversions are tracked based on your conversion metrics configuration

The SDK applies changes quickly after page load. For critical pages (e.g., paid traffic landing pages), you can configure blocking mode:

<script>
window.AB_CONFIG = {
base: "https://appbe.endlesstesting.ai",
blockUntilVariants: true
};
</script>
<script src="https://appbe.endlesstesting.ai/api/sdk.js" async></script>

With blockUntilVariants: true, the page waits for variant allocation before rendering. Use false (default) for non-blocking behavior.