PHPackages                             okdewit/optimizely-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. okdewit/optimizely-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

okdewit/optimizely-php-sdk
==========================

Optimizely SDK for Full Stack PHP projects.

4.0.3(5y ago)1114.0k↑15%1Apache-2.0PHPPHP &gt;=5.5

Since Nov 28Pushed 5y agoCompare

[ Source](https://github.com/okdewit/optimizely-php-sdk)[ Packagist](https://packagist.org/packages/okdewit/optimizely-php-sdk)[ RSS](/packages/okdewit-optimizely-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (46)Used By (1)

Note about this Fork
====================

[](#note-about-this-fork)

This is a forked repository, published separately from the mainstream Optimizely SDK on [packagist](https://packagist.org/packages/okdewit/optimizely-php-sdk). It is tagged as a new Major Release v4.0.0, and depends on Monolog v2.0.0 to resolve a conflict with Laravel 7 and 8 which can not use Monolog v1.0.0.

Optimizely PHP SDK
==================

[](#optimizely-php-sdk)

[![Build Status](https://camo.githubusercontent.com/721d26f8e592b21d32d89af78faace61e1a6da87c47663ff5568fba758636b1c/68747470733a2f2f7472617669732d63692e6f72672f6f7074696d697a656c792f7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/optimizely/php-sdk)[![Coverage Status](https://camo.githubusercontent.com/8abc7f5f07af8261b94c14299e4ddcea96a3f5d9548a9d6b090b1e6ebd00dc50/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f7074696d697a656c792f7068702d73646b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/optimizely/php-sdk?branch=master)[![Total Downloads](https://camo.githubusercontent.com/a93aa11333d8a40f7e1e02d009e8717d3dbbeb7eb11a79d7be1cf303c53c4a8b/68747470733a2f2f706f7365722e707567782e6f72672f6f7074696d697a656c792f6f7074696d697a656c792d73646b2f646f776e6c6f616473)](https://packagist.org/packages/optimizely/optimizely-sdk)[![Apache 2.0](https://camo.githubusercontent.com/7431fbd843a9b4d494723eabad361bee3d30232929d02a7126a30dd99c4655ff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6562756c612d706c7567696e732f677261646c652d65787472612d636f6e66696775726174696f6e732d706c7567696e2e737667)](http://www.apache.org/licenses/LICENSE-2.0)

This repository houses the PHP SDK for use with Optimizely Full Stack and Optimizely Rollouts.

Optimizely Full Stack is A/B testing and feature flag management for product development teams. Experiment in any application. Make every feature on your roadmap an opportunity to learn. Learn more at , or see the [documentation](https://docs.developers.optimizely.com/full-stack/docs).

Optimizely Rollouts is free feature flags for development teams. Easily roll out and roll back features in any application without code deploys. Mitigate risk for every feature on your roadmap. Learn more at , or see the [documentation](https://docs.developers.optimizely.com/rollouts/docs).

Getting Started
---------------

[](#getting-started)

### Installing the SDK

[](#installing-the-sdk)

The Optimizely PHP SDK can be installed through [Composer](https://getcomposer.org/). Please use the following command:

```
php composer.phar require optimizely/optimizely-sdk

```

### Feature Management Access

[](#feature-management-access)

To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.

### Using the SDK

[](#using-the-sdk)

#### Initialization

[](#initialization)

Create the Optimizely client, for example:

```
$optimizely = new Optimizely();
```

Or you may also use OptimizelyFactory method to create an optimizely client using your SDK key, an optional fallback datafile and an optional datafile access token. Using this method internally creates an HTTPProjectConfigManager. See [HTTPProjectConfigManager](#http_config_manager) for further detail.

```
$optimizelyClient = OptimizelyFactory::createDefaultInstance("your-sdk-key", , );
```

To access your HTTPProjectConfigManager:

```
$configManager = $optimizelyClient->configManager;
```

Or you can also provide an implementation of the [`ProjectConfigManagerInterface`](https://github.com/optimizely/php-sdk/blob/master/src/Optimizely/ProjectConfigManager/ProjectConfigManagerInterface.php) in the constructor:

```
$configManager = new HTTPProjectConfigManager();
$optimizely = new Optimizely(, null, null, null, false, null, $configManager);
```

#### ProjectConfigManagerInterface

[](#projectconfigmanagerinterface)

[`ProjectConfigManagerInterface`](https://github.com/optimizely/php-sdk/blob/master/src/Optimizely/ProjectConfigManager/ProjectConfigManagerInterface.php) exposes `getConfig` method for retrieving `ProjectConfig` instance.

####  HTTPProjectConfigManager

[](#-httpprojectconfigmanager)

[`HTTPProjectConfigManager`](https://github.com/optimizely/php-sdk/blob/master/src/Optimizely/ProjectConfigManager/HTTPProjectConfigManager.php)is an implementation of `ProjectConfigManagerInterface` interface.

The `fetch` method makes a blocking HTTP GET request to the configured URL to download the project datafile and initialize an instance of the ProjectConfig.

Calling `fetch` will update the internal ProjectConfig instance that will be returned by `getConfig`.

##### Use HTTPProjectConfigManager

[](#use-httpprojectconfigmanager)

```
$configManager = new HTTPProjectConfigManager();
```

##### SDK key

[](#sdk-key)

Optimizely project SDK key; required unless source URL is overridden.

A notification will be triggered whenever a *new* datafile is fetched and ProjectConfig is updated. To subscribe to these notifications, use the `$notificationCenter->addNotificationListener(NotificationType::OPTIMIZELY_CONFIG_UPDATE, $updateCallback)`.

#### Documentation

[](#documentation)

See the Optimizely Full Stack [developer documentation](https://developers.optimizely.com/x/solutions/sdks/reference/?language=php) to learn how to set up your first Full Stack project and use the SDK.

Development
-----------

[](#development)

### Unit tests

[](#unit-tests)

##### Running all tests

[](#running-all-tests)

You can run all unit tests with:

```
./vendor/bin/phpunit

```

### Contributing

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~43 days

Recently: every ~66 days

Total

38

Last Release

1876d ago

Major Versions

0.1.0 → 1.0.02016-12-13

1.5.x-dev → 2.0.0-beta12018-03-29

2.2.1 → 3.0.02019-03-06

2.2.x-dev → 3.2.02019-08-28

3.4.0 → 4.0.02020-09-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/bab9f8696053ca1263e0b2fcc47a15fd0d637e54c95f93ccfd188aef49353421?d=identicon)[okdewit](/maintainers/okdewit)

---

Top Contributors

[![aliabbasrizvi](https://avatars.githubusercontent.com/u/1548776?v=4)](https://github.com/aliabbasrizvi "aliabbasrizvi (86 commits)")[![oakbani](https://avatars.githubusercontent.com/u/14175871?v=4)](https://github.com/oakbani "oakbani (45 commits)")[![alda-optimizely](https://avatars.githubusercontent.com/u/17035132?v=4)](https://github.com/alda-optimizely "alda-optimizely (22 commits)")[![rashidsp](https://avatars.githubusercontent.com/u/9691567?v=4)](https://github.com/rashidsp "rashidsp (20 commits)")[![mikeproeng37](https://avatars.githubusercontent.com/u/1365958?v=4)](https://github.com/mikeproeng37 "mikeproeng37 (9 commits)")[![okdewit](https://avatars.githubusercontent.com/u/1403548?v=4)](https://github.com/okdewit "okdewit (8 commits)")[![mfahadahmed](https://avatars.githubusercontent.com/u/4477057?v=4)](https://github.com/mfahadahmed "mfahadahmed (6 commits)")[![msohailhussain](https://avatars.githubusercontent.com/u/3163521?v=4)](https://github.com/msohailhussain "msohailhussain (5 commits)")[![juancarlostong](https://avatars.githubusercontent.com/u/40373238?v=4)](https://github.com/juancarlostong "juancarlostong (4 commits)")[![zashraf1985](https://avatars.githubusercontent.com/u/35262377?v=4)](https://github.com/zashraf1985 "zashraf1985 (3 commits)")[![jaeopt](https://avatars.githubusercontent.com/u/45045038?v=4)](https://github.com/jaeopt "jaeopt (2 commits)")[![onufryk](https://avatars.githubusercontent.com/u/597019?v=4)](https://github.com/onufryk "onufryk (2 commits)")[![ozayr-zaviar](https://avatars.githubusercontent.com/u/54209343?v=4)](https://github.com/ozayr-zaviar "ozayr-zaviar (2 commits)")[![caitlinrubin-optimizely](https://avatars.githubusercontent.com/u/28716513?v=4)](https://github.com/caitlinrubin-optimizely "caitlinrubin-optimizely (2 commits)")[![yasirfolio3](https://avatars.githubusercontent.com/u/39988750?v=4)](https://github.com/yasirfolio3 "yasirfolio3 (2 commits)")[![cleentfaar](https://avatars.githubusercontent.com/u/795661?v=4)](https://github.com/cleentfaar "cleentfaar (1 commits)")[![wangjoshuah](https://avatars.githubusercontent.com/u/5353594?v=4)](https://github.com/wangjoshuah "wangjoshuah (1 commits)")[![mauerbac](https://avatars.githubusercontent.com/u/1507886?v=4)](https://github.com/mauerbac "mauerbac (1 commits)")[![YuanC](https://avatars.githubusercontent.com/u/8098044?v=4)](https://github.com/YuanC "YuanC (1 commits)")[![Spea](https://avatars.githubusercontent.com/u/495017?v=4)](https://github.com/Spea "Spea (1 commits)")

---

Tags

sdkoptimizely

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/okdewit-optimizely-php-sdk/health.svg)

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

###  Alternatives

[optimizely/optimizely-sdk

Optimizely PHP SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts

191.8M1](/packages/optimizely-optimizely-sdk)[stingbo/easyexchange

easy use digital currency exchange sdk

871.3k](/packages/stingbo-easyexchange)

PHPackages © 2026

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