Developer Reference

This section is for developers who want to go beyond the basics.

What is available

A vs B ships a set of developer tools. You will not need all of them for every experiment. Knowing what each one does helps you pick the right one for the job.

  • Snippet SDK (window.avsb): the public JavaScript API the snippet puts on every page where it runs. Use it to track custom events and tag visitors into segments. You can also force a variation (one version being tested) for QA, wait for elements to appear, and send data to other analytics tools.
  • CLI tool + Chrome extension: a command-line tool and a browser extension that work together. Clone an experiment to your computer and edit its code in your own editor, with TypeScript and SCSS. Save a change and watch it appear live in Chrome, then push the finished code back to the platform.
  • Public REST API: manage experiments, metrics, and results over HTTP, authenticated with a service token or your own personal access token.
  • Personal access tokens: long-lived tokens tied to your account. They sign you in to the CLI tool and the REST API. Create and revoke them from your account settings.
  • Credentials: A vs B uses four kinds of credential: personal access token, service token, SDK key, and snippet key. Credentials explains what each one looks like, where you find it, and which two are safe to share publicly.

In this section

Was this helpful?