Socket
Socket
Sign inDemoInstall

@algolia/client-abtesting

Package Overview
Dependencies
Maintainers
86
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/client-abtesting

JavaScript client for client-abtesting


Version published
Weekly downloads
84K
decreased by-0.7%
Maintainers
86
Weekly downloads
 
Created

What is @algolia/client-abtesting?

@algolia/client-abtesting is an npm package that provides tools for managing A/B testing within the Algolia search platform. It allows developers to create, manage, and monitor A/B tests to optimize search performance and user experience.

What are @algolia/client-abtesting's main functionalities?

Create an A/B Test

This feature allows you to create a new A/B test by specifying the variants, traffic distribution, and end date. The code sample demonstrates how to initialize the A/B testing client and create a test with two variants.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const abTesting = client.initABTesting();

const abTest = {
  name: 'my-ab-test',
  variants: [
    { index: 'indexA', trafficPercentage: 50, description: 'Variant A' },
    { index: 'indexB', trafficPercentage: 50, description: 'Variant B' }
  ],
  endAt: '2023-12-31T00:00:00Z'
};

abTesting.addABTest(abTest).then(({ abTestID }) => {
  console.log('A/B Test created with ID:', abTestID);
});

Get an A/B Test

This feature allows you to retrieve the details of an existing A/B test by its ID. The code sample shows how to fetch and log the details of a specific A/B test.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const abTesting = client.initABTesting();

const abTestID = 12345;

abTesting.getABTest(abTestID).then(abTest => {
  console.log('A/B Test details:', abTest);
});

Stop an A/B Test

This feature allows you to stop an ongoing A/B test by its ID. The code sample demonstrates how to stop a specific A/B test.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const abTesting = client.initABTesting();

const abTestID = 12345;

abTesting.stopABTest(abTestID).then(() => {
  console.log('A/B Test stopped');
});

Other packages similar to @algolia/client-abtesting

FAQs

Package last updated on 20 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc