
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@testit-sdk/express
Advanced tools
AbTest is a lightweight TypeScript library for implementing A/B testing in Express.js applications. It provides an easy way to create and manage experiments, assign users to variants, and check variant assignments. This package is made to work with Test It but can be used without it if you have your own analytics system.
npm install @testit-sdk/express
import AbTest from "@testit-sdk/express";
import express from "express";
const app = express();
app.get("/", (req, res) => {
const abTest = new AbTest({
experimentId: "66d6381d630d87321d2937c6",
variants: [
{ id: "66d6621d630d87341d2937f3", name: "baseline", weight: 50 },
{ id: "66d6681c630d87341d2936d4", name: "v_1", weight: 50 },
],
req,
res,
});
if (abTest.isVariant("v_1")) {
res.send('<button style="background-color: blue;">Click me!</button>');
} else {
res.send('<button style="background-color: red;">Click me!</button>');
}
});
app.listen(3000, () => console.log("Server running on port 3000"));
options.experimentId: Unique identifier for the experimentoptions.variants: Array of variant objects with id, name, and weight propertiesoptions.req: Express request objectoptions.res: Express response objectisVariant(variantName: string): boolean: Check if the current user is assigned to a specific variantisV(variantName: string): boolean: Alias for isVariantAbTest uses cookies to persistently assign users to variants. When a user first encounters an experiment, they are randomly assigned to a variant based on the specified weights. This assignment is stored in a cookie and reused for subsequent requests.
FAQs
An A/B testing utility for Express applications.
We found that @testit-sdk/express demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.