A/B testing API client
The A/B testing API client is part of the algoliasearch
package.
To install this package, run:
1
npm install algoliasearch
To use the A/B testing client:
1
2
3
4
import { algoliasearch } from "algoliasearch";
const client = algoliasearch("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
const abtestingClient = client.initAbtesting({ 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 API client, you can install its package on its own:
1
npm install @algolia/client-abtesting
To use it, run:
1
2
3
4
5
6
7
import { abtestingClient } from "@algolia/client-abtesting";
const client = abtestingClient(
"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 |