A/B testing API client (v3)
The A/B testing v3 API client is part of the algoliasearch package.
To install this package, run:
1
npm install algoliasearch
To use the A/B testing v3 client:
1
2
3
4
import { algoliasearch } from "algoliasearch";
const client = algoliasearch("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
const abtestingV3Client = client.initAbtestingV3({ region: "ALGOLIA_APPLICATION_ID_REGION" });
Replace ALGOLIA_APPLICATION_ID_REGION with your Algolia application’s analytics region: us for the United States or de for Europe.
You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.
The algoliasearch package includes API clients for the Search, Recommend, Analytics, A/B testing, and Personalization API.
If you just want to use the A/B testing v3 API client, you can install its package on its own:
1
npm install @algolia/abtesting
To use it, run:
1
2
3
4
5
6
7
import { abtestingV3Client } from "@algolia/abtesting";
const client = abtestingV3Client(
"ALGOLIA_APPLICATION_ID",
"ALGOLIA_API_KEY",
"ALGOLIA_APPLICATION_ID_REGION"
);
List of methods
Each method makes one request to the A/B testing API.
A/B testing
| client.listABTests | List all A/B tests |
| client.addABTests | Create an A/B test |
| client.getABTest | Retrieve A/B test details |
| client.deleteABTest | Delete an A/B test |
| client.stopABTest | Stop an A/B test |
| client.scheduleABTest | Schedule an A/B test |
| client.estimateABTest | Estimate the sample size and duration of an A/B test |
| client.getTimeseries | Retrieve timeseries of an A/B test |