Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

teamgantt-split-test

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teamgantt-split-test

A library to randomly put a user in view the original version (Control) or view an experimental version (Variation) of a test.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

teamgantt-split-test

Using the split-test library

  • First import the library:
import {NAME_OF_SPLIT_TEST} from '/path/to/constants/split-test-experiments';
import tgSplitTest from 'teamgantt-split-test';
  • Check if the user is in the split-test:
const isUserInSplitTest = tgSplitTest.isInExperiment(NAME_OF_SPLIT_TEST);

Note: If the user is not in the current split test, it will place them in the test and return their placement.

  • The experiment should be handled in such a way that it follows the following logic:
if (isUserInSplitTest) {
    // the experiment, the current user should see the changes from the split test
} else {
    // the original, the current user should not see any changes
}

Using the JS file as a script tag:

  • Import the split-test bundle:
<script language="javascript" src="https://split-test.teamgantt.com/index.js"></script>
  • Check if the user is in the split-test:
var isUserInSplitTest = window.tgSplitTest.isInExperiment(NAME_OF_SPLIT_TEST);
  • See step #3 above.

Keywords

split

FAQs

Package last updated on 27 Sep 2021

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