PHPackages                             taplytics/taplytics-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. taplytics/taplytics-php

AbandonedArchivedLibrary[API Development](/categories/api)

taplytics/taplytics-php
=======================

Taplytics PHP SDK for fast A/B testing and Feature Flagging

1.1.0(7y ago)171[1 issues](https://github.com/taplytics/taplytics-php-sdk/issues)[1 PRs](https://github.com/taplytics/taplytics-php-sdk/pulls)http://taplytics.com/licensePHPPHP &gt;=5.4.0

Since Apr 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/taplytics/taplytics-php-sdk)[ Packagist](https://packagist.org/packages/taplytics/taplytics-php)[ Docs](http://decisions-docs.taplytics.com)[ RSS](/packages/taplytics-taplytics-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

[![CircleCI](https://camo.githubusercontent.com/2b24c2580d52ecb2ced85f5e0ce83bc4296735968aeb61d65e92870e520628e3/68747470733a2f2f636972636c6563692e636f6d2f67682f7461706c79746963732f7461706c79746963732d7068702e7376673f7374796c653d73766726636972636c652d746f6b656e3d64303265363230333762376264613133653061353639383833363338313734373863336337633963)](https://circleci.com/gh/taplytics/taplytics-php)

Getting started
===============

[](#getting-started)

Taplytics PHP SDK enables the delivery of server-side experiments, feature flags and functionality at edge.

How to Build
------------

[](#how-to-build)

Refer to [Getting Started](START.md) to build Taplytics into your project.

Initialization
--------------

[](#initialization)

API client can be initialized as following.

```
$client = new TaplyticsLib\TaplyticsClient();
```

Class Reference
===============

[](#class-reference)

APIController
-------------

[](#apicontroller)

### Get singleton instance

[](#get-singleton-instance)

The singleton instance of the `APIController` class can be accessed from the API Client.

```
$client = $client->getClient();
```

### createGetVariables

[](#creategetvariables)

> All variables and their values for the given user

```
function createGetVariables(
        $token,
        $userId,
        $body = null)
```

#### Parameters

[](#parameters)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userbody`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage)

```
$token = 'token';
$userId = 'user_id';
$body = new Body();

$result = $client->createGetVariables($token, $userId, $body);
```

### createGetVariationForExperiment

[](#creategetvariationforexperiment)

> For a given experiment, determine whether or not a user is in the experiment, and in which variation

```
function createGetVariationForExperiment(
        $token,
        $userId,
        $experimentName,
        $body = null)
```

#### Parameters

[](#parameters-1)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userexperimentName`Required`Name of an Experimentbody`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage-1)

```
$token = 'token';
$userId = 'user_id';
$experimentName = 'experimentName';
$body = new Body();

$result = $client->createGetVariationForExperiment($token, $userId, $experimentName, $body);
```

### createGetVariableValue

[](#creategetvariablevalue)

> 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.

```
function createGetVariableValue(
        $token,
        $userId,
        $varName,
        $defaultValue,
        $body = null)
```

#### Parameters

[](#parameters-2)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given uservarName`Required`name of variabledefaultValue`Required`default value to be used if user does not have variable available.body`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage-2)

```
$token = 'token';
$userId = 'user_id';
$varName = 'varName';
$defaultValue = 'defaultValue';
$body = new Body();

$result = $client->createGetVariableValue($token, $userId, $varName, $defaultValue, $body);
```

### createGetBucketing

[](#creategetbucketing)

> Returns a key/value pairing of all experiments that the user has been segmented into, as well as the variation the users are assigned.

```
function createGetBucketing(
        $token,
        $userId,
        $body = null)
```

#### Parameters

[](#parameters-3)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for current userbody`Optional`Provide all relevant attributes associated with the user#### Example Usage

[](#example-usage-3)

```
$token = 'token';
$userId = 'user_id';
$body = new Body();

$result = $client->createGetBucketing($token, $userId, $body);
```

### postEvent

[](#postevent)

> 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.

```
function postEvent(
        $token,
        $userId,
        $body = null)
```

#### Parameters

[](#parameters-4)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userbody`Optional`Provide an array of events, as well as all additional relevant user attributes.#### Example Usage

[](#example-usage-4)

```
$token = 'token';
$userId = 'user_id';
$body = array(
	'events' => array(
	        		array('eventName' => 'event name!', 'eventValue' => 5)
				)
);

$result = $client->postEvent($token, $userId, $body);
```

The format for passing in events is as follows:

```
{
	attributes: {
		name: '',
		...
	},
	events: [
		{eventName: '', eventValue},
		...
	]
}

```

### createGetConfig

[](#creategetconfig)

> 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.

```
function createGetConfig(
        $token,
        $userId,
        $body = null)
```

#### Parameters

[](#parameters-5)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userbody`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage-5)

```
$token = 'token';
$userId = 'user_id';
$body = new Body();

$result = $client->createGetConfig($token, $userId, $body);
```

### createGetFeatureFlags

[](#creategetfeatureflags)

> Returns the list of feature flags with names and key names.

```
function createGetFeatureFlags(
        $token,
        $userId,
        $body = null)
```

#### Parameters

[](#parameters-6)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userbody`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage-6)

```
$token = 'token';
$userId = 'user_id';
$body = new Body();

$result = $client->createGetFeatureFlags($token, $userId, $body);
foreach($result as $flagObj) {
        // $flagObj->name to get the name of the feature flag
        // $flagObj->keyName to get the key of the feature flag
}
```

### isFeatureFlagEnabled

[](#isfeatureflagenabled)

> Returns true or false based on if the keyName passed in is an enabled feature flag.

```
function isFeatureFlagEnabled(
        $token,
        $userId,
        $keyName,
        $body = null)
```

#### Parameters

[](#parameters-7)

ParameterTagsDescriptiontoken`Required`SDK token for the projectuserId`Required`ID for given userkeyName`Required`key name for the feature flagbody`Optional`All relevant attributes associated with the user#### Example Usage

[](#example-usage-7)

```
$token = 'token';
$userId = 'user_id';
$keyName = 'featureFlagKey';
$body = new Body();

$result = $client->isFeatureFlagEnabled($token, $userId, $keyName, $body);
if ($result) {
        showFeature();
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2644d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34827f938b9851a099d153a8dbad2c9f078d3e07d45c7e73274952fc56378dfe?d=identicon)[jsalaber](/maintainers/jsalaber)

---

Top Contributors

[![VicV](https://avatars.githubusercontent.com/u/1301285?v=4)](https://github.com/VicV "VicV (6 commits)")[![jsalaber](https://avatars.githubusercontent.com/u/10345366?v=4)](https://github.com/jsalaber "jsalaber (2 commits)")[![willlam](https://avatars.githubusercontent.com/u/4070963?v=4)](https://github.com/willlam "willlam (2 commits)")

---

Tags

phpapisdkTaplytics Decisions API

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/taplytics-taplytics-php/health.svg)

```
[![Health](https://phpackages.com/badges/taplytics-taplytics-php/health.svg)](https://phpackages.com/packages/taplytics-taplytics-php)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

138110.7k2](/packages/jstolpe-instagram-graph-api-php-sdk)[clever/clever-php

231.6k](/packages/clever-clever-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
