
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Taplytics decisions is an API to quickly use Taplytics features and functionality at edge.
API client can be initialized as following:
First install the SDK to your project
npm install taplytics
Then import it
var taplytics = require('taplytics')('API_KEY');
All method calls to Taplytics require a user id. This is to ensure that the user will always receive the correct experiments and variations across all platforms.
All methods can use either a callback as a param, or used as a promise, i.e.
taplytics.getConfig(...).then(val => {
// use val
}).catch(err => {
// error err
})
If a callback is provided, the function will not return a promise.
Returns a key/value pairing of all experiments that the user has been segmented into, as well as the variation the users are assigned.
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for current user |
attributes | Optional | Provide all relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var body = { attributes:{ key:'value', key2:'value2' } }
taplytics.getBucketing(userId, body, (err, bucketing) => {
// your code here
})
All variables and their values for the given user
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.getVariables(userId, attributes, (err, variables) => {
// your code here
})
For a given experiment, determine whether or not a user is in the experiment, and in which variation
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
experimentName | Required | Name of an Experiment |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = 'user_id'
var experimentName = 'experimentName';
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.getVariationForExperiment(userId, experimentName, attributes,(error, variation) => {
// your code here
})
Value for given Taplytics Dynamic Variable. If a user is not in an experiment containing the variable, the response be the provided default value in the query params.
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
varName | Required | name of variable |
defaultValue | Required | default value to be used if user does not have variable available. |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id;
var varName = 'varName';
var defaultValue = 'defaultValue';
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.getVariableValue(userId, varName, defaultValue, attributes, (err, value) => {
// your code here
});
Send an event to Taplytics. These events are then used to compare against an experiment's goals to determine the success of an A/B test.
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
body | Optional | Provide an array of events, as well as all additional relevant user attributes. |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var body = {
attributes: {key: 'value'},
events: [
{ eventName: 'event 1', eventValue: 3 },
{ eventName: 'event 2' }
]
}
taplytics.postEvent(userId, body, (error, response) => {
// your code here
})
Returns the entire configuration for the project. This is the document that informs the experiment information such as segmentation. Extremely verbose and should be used for debugging.
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.getConfig(userId, attributes, (error, config) => {
// your code here
})
Returns array of all the enabled feature flags for this project. Each object in the array has
name
for the name of the feature flag andkeyName
for the feature flag's key to be used in your code
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.getFeatureFlags(userId, attributes, (error, featureFlags) => {
// your code here
})
Returns true or false depending if the
keyName
provided corresponds to an enabled featureFlag in your Taplytics project
Parameter | Tags | Description |
---|---|---|
userId | Required | ID for given user |
keyName | Required | Key name for the feature flag |
attributes | Optional | All relevant attributes associated with the user |
callback | Optional | Provide a callback if you don't want to use a promise |
var userId = user_id
var attributes = { attributes:{ key:'value', key2:'value2' } }
taplytics.isFeatureFlagEnabled(userId, attributes, (error, enabled) => {
if (enabled) {
enableFeature();
}
})
FAQs
Taplytics Node.js SDK for fast A/B testing and Feature Flagging
The npm package taplytics receives a total of 11 weekly downloads. As such, taplytics popularity was classified as not popular.
We found that taplytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.