PackageTrack
Sign in Get early access

optimizely/optimizely-sdk

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

4.0.3 2.0M downloads/mo #4256 most downloaded on Packagist optimizely/php-sdk

What this package is like to depend on

Last release 3 months ago

20 May 2026

Release timing varies

gaps range from 2 weeks to 1.3 years

Nearly every release is documented

notes for 37 of 37 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

38 releases · first in 2016

1 release in the last 12 months

see the full history below

Release timeline

38 releases · Nov 2016 to May 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 38
  1. 4.0.3 20 May 2026
    Release notes

    What's Changed

    • [FSSDK-12316] [Security] Fix curl|bash vulnerability in SourceClear scan by @Tamara-Barum in #294
    • [FSSDK-12610] Fix: PHP 8.4 implicit nullable parameter deprecation warnings by @Tamara-Barum in #296
    • [FSSDK-12610] chore: Prepare release 4.0.3 by @Tamara-Barum in #297

    New Contributors

    Full Changelog: 4.0.2...4.0.3

    Open source →
    Release notes

    May 20, 2026

    • Fix: PHP 8.4 implicit nullable parameter deprecation warnings #296
    • Security: Fix curl|bash vulnerability in SourceClear scan #294
    Open source →
  2. 4.0.2 16 Mar 2025
    Release notes

    What's Changed

    • [FSSDK-10665] fix: Github Actions YAML files vulnerable to script injections corrected in #287
    • [FSSDK-10015] Fix: Explicitly define class properties in #288

    New Contributors

    Full Changelog: 4.0.1...4.0.2

    Open source →
    Release notes

    March 14, 2025

    • Fix: Explicitly define class properties #288
    Open source →
  3. 4.0.1 04 Dec 2023
    Release notes

    What's Changed

    Full Changelog: 4.0.0...4.0.1

    Open source →
    Release notes

    December 4, 2023

    • Add Dev Containers and bug bash #269
    • Add GitHub Issues templates #278
    • Fix: Deprecation warning #279
    • Return Latest Experiment When Duplicate Keys in Config #280
    • Fix: Code examples by @localheinz #281
    Open source →
  4. 4.0.0 12 Jun 2023
    Release notes

    4.0.0

    June 12, 2023

    • Provided support for PHP version 8.x.
    • Version 4.0.0 requires PHP8+.
    • Version 3 requires PHP5.5+ up to PHP7.
    Open source →
    Release notes

    June 12, 2023

    • Provided support for PHP version 8.x.
    • Version 4.0.0 requires PHP8+.
    • Version 3 requires PHP5.5+ up to PHP7.
    Open source →
  5. 3.10.0 09 Jun 2023
    Release notes
    • Update EventBuilder.php

    • Update EventBuilderTest.php

    • Update CHANGELOG.md

    Open source →
  6. 3.9.4 29 Mar 2023
    Release notes

    3.9.4

    March 29 , 2023

    • We have made changes to avoid unnecessary deprecation notices and fixed some incorrect return hints. (#265).
    Open source →
    Release notes

    March 29 , 2023

    • We have made changes to avoid unnecessary deprecation notices and fixed some incorrect return hints. (#265).
    Open source →
  7. 3.9.3 13 Mar 2023
    Release notes

    March 13, 2023

    • We updated our README.md and other non-functional code to reflect that this SDK supports both Optimizely Feature Experimentation and Optimizely Full Stack. (#261).
    Open source →
    Release notes

    March 13, 2023

    • We updated our README.md and other non-functional code to reflect that this SDK supports both Optimizely Feature Experimentation and Optimizely Full Stack. (#261).
    Open source →
  8. 3.9.2 30 Sep 2022
    Release notes

    3.9.2

    October 5th, 2022

    Bug Fixes

    • String type casting added to avoid deprecation notices when passing null to strlen. (#253)
    Open source →
    Release notes

    October 5th, 2022

    Bug Fixes

    • String type casting added to avoid deprecation notices when passing null to strlen. (#253)
    Open source →
  9. 3.9.1 31 May 2022
    Release notes

    3.9.1

    May 31st, 2022

    Bug Fixes

    • Since php 8.1 internal functions are using proper return types. This results in deprecation notices for some of the methods. To suppress the notice for php8.1+ the new ReturnTypeWillChange attribute is added to the method in question. (#242)

    • In HTTPProjectConfigManager fetchDatafile function datafile should be a string. So it is fixed by using ->getContents() which returns string. (#243, #247)

    • Return type should be ProjectConfigInterface when calling createProjectConfigFromDatafile method. (#249)

    Open source →
    Release notes

    May 31st, 2022

    Bug Fixes

    • Since php 8.1 internal functions are using proper return types. This results in deprecation notices for some of the methods. To suppress the notice for php8.1+ the new ReturnTypeWillChange attribute is added to the method in question. (#242)

    • In HTTPProjectConfigManager fetchDatafile function datafile should be a string. So it is fixed by using ->getContents() which returns string. (#243, #247)

    • Return type should be ProjectConfigInterface when calling createProjectConfigFromDatafile method. (#249)

    Open source →
  10. 3.9.0 10 Jan 2022
    Release notes

    3.9.0

    January 10th, 2022

    New Features

    • Add a set of new APIs for overriding and managing user-level flag, experiment and delivery rule decisions. These methods can be used for QA and automated testing purposes. They are an extension of the OptimizelyUserContext interface (#233, #236, #237, #238)
      • setForcedDecision
      • getForcedDecision
      • removeForcedDecision
      • removeAllForcedDecisions

    Enhancements

    • Updated SDK to support latest versions of PHP and Laravel by removing major version restrictions for monolog/monolog and guzzlehttp/guzzle (#235).
    Open source →
    Release notes

    January 10th, 2022

    New Features

    • Add a set of new APIs for overriding and managing user-level flag, experiment and delivery rule decisions. These methods can be used for QA and automated testing purposes. They are an extension of the OptimizelyUserContext interface (#233, #236, #237, #238)
      • setForcedDecision
      • getForcedDecision
      • removeForcedDecision
      • removeAllForcedDecisions
    Open source →
  11. 3.8.0 16 Sep 2021
    Release notes

    September 16th, 2021

    New Features:

    Deprecated:

    • OptimizelyFeature.experimentsMap of OptimizelyConfig is deprecated as of this release. Please use OptimizelyFeature.experimentRules and OptimizelyFeature.deliveryRules. (#230)
    Open source →
  12. 3.7.1 04 Aug 2021
    Release notes

    August 4th, 2021

    Bug Fixes

    • Fixed duplicate experiment key issue with multiple feature flags. While trying to get variation from the variationKeyMap, it was unable to find because the latest experiment key was overriding the previous one. #226
    Open source →
  13. 3.7.0 17 Feb 2021
    Release notes

    February 17th, 2021

    New Features:

    • Introducing a new primary interface for retrieving feature flag status, configuration and associated experiment decisions for users (#220, #224). The new OptimizelyUserContext class is instantiated with createUserContext and exposes the following APIs to get OptimizelyDecision:

      • setAttribute
      • decide
      • decideAll
      • decideForKeys
      • trackEvent
    • For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/php-sdk.

    Open source →
  14. 3.6.1 20 Nov 2020
    Release notes

    November 19th, 2020

    Bug Fixes

    • Added "enabled" field to decision metadata structure. #217
    Open source →
  15. 3.6.0 03 Nov 2020
    Release notes

    November 2nd, 2020

    New Features

    • Added support for upcoming application-controlled introduction of tracking for non-experiment Flag decisions. #215
    Open source →
  16. 3.5.0 01 Oct 2020
    Release notes

    October 1st, 2020

    New Features:

    • Version targeting using semantic version syntax. #213
    • Datafile accessor API added to access current config as a JSON string. #211
    Open source →
  17. 3.4.0 08 Jul 2020
    Release notes

    July 8th, 2020

    New Features:

    • Introduced 2 APIs to interact with feature variables:
      • getFeatureVariableJSON allows you to get value for JSON variables related to a feature.
      • getAllFeatureVariables gets values for all variables under a feature.
    • Added support for fetching authenticated datafiles. HTTPProjectConfigManager now accepts datafileAccessToken to be able to fetch datafiles belonging to secure environments.

    Bug Fixes:

    • Adjusted log level for audience evaluation logs. (#198)
    Open source →
  18. 3.3.1 28 May 2020
    Release notes

    May 28th, 2020

    Bug Fixes:

    • This release adds an SDK key param to Optimizely constructor. The user can now create an Optimizely instance only using an SDK key. Previously the user was required to create a HTTPProjectConfigManager, and pass it as a config manager in the constructor. (#189, #193)
    Open source →
  19. 3.3.0 28 Jan 2020
    Release notes

    January 27th, 2020

    New Features:

    • Added a new API to get project configuration static data.
    Open source →
  20. 3.2.0 28 Aug 2019
    Release notes

    August 28th, 2019

    New Features:

    • Added support for datafile management via HTTPProjectConfigManager:
      $configManager = new HTTPProjectConfigManager(<<SDK_KEY>>);
      $optimizely = new Optimizely(<<DATAFILE>>, null, null, null, false, null, $configManager);  
      
      • The fetch method allows you to refresh the config. In order to update the config, you can do something like:
      $configManager->fetch();
      
      • Configuration updates can be subscribed to by adding the OPTIMIZELY_CONFIG_UPDATE notification listener.
    Open source →
  21. 3.1.0 03 May 2019
    Release notes

    May 3rd, 2019

    New Features:

    • Introduced Decision notification listener to be able to record:
      • Variation assignments for users activated in an experiment.
      • Feature access for users.
      • Feature variable value for users.

    Bug Fixes:

    • Feature variable APIs return default variable value when featureEnabled property is false. (#159)

    Deprecated

    • Activate notification listener is deprecated as of this release. Recommendation is to use the new Decision notification listener. Activate notification listener will be removed in the next major release.
    Open source →
  22. 3.0.1 19 Apr 2019
    Release notes

    April 19th, 2019

    Security Fix:

    • Removed CurlEventDispatcher. (#168)
      • ID: opt-2019-0001
      • Overall CVSSv3: 6.0
      • Optimizely Severity: High
    Open source →
  23. 3.0.0 06 Mar 2019
    Release notes

    March 6th, 2019

    The 3.0 release improves event tracking and supports additional audience targeting functionality.

    New Features:

    • Event tracking:
      • The track method now dispatches its conversion event unconditionally, without first determining whether the user is targeted by a known experiment that uses the event. This may increase outbound network traffic.
      • In Optimizely results, conversion events sent by 3.0 SDKs don't explicitly name the experiments and variations that are currently targeted to the user. Instead, conversions are automatically attributed to variations that the user has previously seen, as long as those variations were served via 3.0 SDKs or by other clients capable of automatic attribution, and as long as our backend actually received the impression events for those variations.
      • Altogether, this allows you to track conversion events and attribute them to variations even when you don't know all of a user's attribute values, and even if the user's attribute values or the experiment's configuration have changed such that the user is no longer affected by the experiment. As a result, you may observe an increase in the conversion rate for previously-instrumented events. If that is undesirable, you can reset the results of previously-running experiments after upgrading to the 3.0 SDK.
      • This will also allow you to attribute events to variations from other Optimizely projects in your account, even though those experiments don't appear in the same datafile.
      • Note that for results segmentation in Optimizely results, the user attribute values from one event are automatically applied to all other events in the same session, as long as the events in question were actually received by our backend. This behavior was already in place and is not affected by the 3.0 release.
    • Support for all types of attribute values, not just strings.
      • All values are passed through to notification listeners.
      • Strings, booleans, and valid numbers are passed to the event dispatcher and can be used for Optimizely results segmentation. A valid number is a finite float or int in the inclusive range [-2⁵³, 2⁵³].
      • Strings, booleans, and valid numbers are relevant for audience conditions.
    • Support for additional matchers in audience conditions:
      • An exists matcher that passes if the user has a non-null value for the targeted user attribute and fails otherwise.
      • A substring matcher that resolves if the user has a string value for the targeted attribute.
      • gt (greater than) and lt (less than) matchers that resolve if the user has a valid number value for the targeted attribute. A valid number is a finite float or int in the inclusive range [-2⁵³, 2⁵³].
      • The original (exact) matcher can now be used to target booleans and valid numbers, not just strings.
    • Support for A/B tests, feature tests, and feature rollouts whose audiences are combined using "and" and "not" operators, not just the "or" operator.
    • Datafile-version compatibility check: The SDK will remain uninitialized (i.e., will gracefully fail to activate experiments and features) if given a datafile version greater than 4.
    • Updated Pull Request template and commit message guidelines.

    Breaking Changes:

    • Conversion events sent by 3.0 SDKs don't explicitly name the experiments and variations that are currently targeted to the user, so these events are unattributed in raw events data export. You must use the new results export to determine the variations to which events have been attributed.
    • Previously, notification listeners were only given string-valued user attributes because only strings could be passed into various method calls. That is no longer the case. You may pass non-string attribute values, and if you do, you must update your notification listeners to be able to receive whatever values you pass in.
      • We're also renaming the clearNotifications and cleanAllNotifications methods. They're now called clearNotificationListeners and clearAllNotificationListeners, respectively. The original methods are now deprecated and will be dropped in a future release. (#120)

    Bug Fixes:

    • Experiments and features can no longer activate when a negatively targeted attribute has a missing, null, or malformed value.
      • Audience conditions (except for the new exists matcher) no longer resolve to false when they fail to find an legitimate value for the targeted user attribute. The result remains null (unknown). Therefore, an audience that negates such a condition (using the "not" operator) can no longer resolve to true unless there is an unrelated branch in the condition tree that itself resolves to true.
    • All methods now validate that user IDs are strings and that experiment keys, feature keys, feature variable keys, and event keys are non-empty strings.
    • Ignore the user's whitelisted variation if it has been stopped. (#123)
    Open source →
  24. 2.2.1 14 Nov 2018
    Release notes

    November 14th, 2018

    Bug fixes

    • fix(generateBucketValue): Avoid negative bucket number for PHP x86. (#137)
    • fix(phpdoc-notification-callback): Fixes phpdoc primitive type of notification-callback. (#135)
    Open source →
  25. 2.2.0 01 Nov 2018
    Release notes

    October 29th, 2018

    New Features

    • feat(isValid): Adds getter to access isValid attribute. (#128)

    Bug fixes

    • fix(datafile-parsing): Prevent newer versions datafile. (#127)
    • fix: Updating dependencies. (#125)
    • fix(track): Send decisions for all experiments using an event when using track. (#124)
    Open source →
  26. 2.1.0 29 Jun 2018
    Release notes

    June 29th, 2018

    • Introduces support for bot filtering (#110).
    Open source →
  27. 2.0.1 20 Jun 2018
    Release notes

    June 19th, 2018

    • Fix: send impression event for Feature Test when Feature is disabled (#114).
    Open source →
  28. 2.0.0 12 Apr 2018
    Release notes

    April 12th, 2018

    This major release introduces APIs for Feature Management. It also introduces some breaking changes listed below.

    New Features

    • Introduced the isFeatureEnabled API to determine whether to show a feature to a user or not.
    $isEnabled = $optimizelyClient->isFeatureEnabled('my_feature_key', 'my_user', $userAttributes);
    
    • You can also get all the enabled features for the user by calling:
    $enabledFeatures = $optimizelyClient->getEnabledFeatures('my_user', $userAttributes);
    
    • Introduced Feature Variables to configure or parameterize a feature. There are four variable types: String, Integer, Double, Boolean.
    $stringVariable = $optimizelyClient->getFeatureVariableString('my_feature_key', 'string_variable_key', 'my_user');
    $integerVariable = $optimizelyClient->getFeatureVariableInteger('my_feature_key', 'integer_variable_key', 'my_user');
    $doubleVariable = $optimizelyClient->getFeatureVariableDouble('my_feature_key', 'double_variable_key', 'my_user');
    $booleanVariable = $optimizelyClient->getFeatureVariableBoolean('my_feature_key', 'boolean_variable_key', 'my_user');
    

    Breaking changes

    • The track API with revenue value as a stand-alone parameter has been removed. The revenue value should be passed in as an entry in the event tags dict. The key for the revenue tag is revenue and the passed in value will be treated by Optimizely as the value for computing results.
    $eventTags = ['revenue' => 4200];
    
    $optimizelyClient->track('event_key', 'user_id', $userAttributes, $eventTags);
    
    Open source →
  29. 2.0.0-beta1 29 Mar 2018 pre-release
    Release notes

    May 29th, 2018

    This beta release introduces APIs for Feature Management. It also introduces some breaking changes listed below.

    New Features

    • Introduced the isFeatureEnabled API to determine whether to show a feature to a user or not.
    $isEnabled = $optimizelyClient->isFeatureEnabled('my_feature_key', 'my_user', $userAttributes);
    
    • You can also get all the enabled features for the user by calling:
    $enabledFeatures = $optimizelyClient->getEnabledFeatures('my_user', $userAttributes);
    
    • Introduced Feature Variables to configure or parameterize a feature. There are four variable types: String, Integer, Double, Boolean.
    $stringVariable = $optimizelyClient->getFeatureVariableString('my_feature_key', 'string_variable_key', 'my_user');
    $integerVariable = $optimizelyClient->getFeatureVariableInteger('my_feature_key', 'integer_variable_key', 'my_user');
    $doubleVariable = $optimizelyClient->getFeatureVariableDouble('my_feature_key', 'double_variable_key', 'my_user');
    $booleanVariable = $optimizelyClient->getFeatureVariableBoolean('my_feature_key', 'boolean_variable_key', 'my_user');
    

    Breaking changes

    • The track API with revenue value as a stand-alone parameter has been removed. The revenue value should be passed in as an entry in the event tags dict. The key for the revenue tag is revenue and the passed in value will be treated by Optimizely as the value for computing results.
    $eventTags = ['revenue' => 4200];
    
    $optimizelyClient->track('event_key', 'user_id', $userAttributes, $eventTags);
    
    Open source →
  30. 1.5.0 15 Dec 2017
    Release notes
    • Added support for notification listeners.
    • Added support for IP anonymization.
    Open source →
  31. 1.4.0 25 Sep 2017
    Release notes
    • Added support for Numeric Metrics.
    • Switched to new event API.
    Open source →
  32. 1.3.0 28 Aug 2017
    Release notes
    • Added the forced bucketing feature, which allows customers to force users into variations in real time for QA purposes without requiring datafile downloads from the network. The following APIs are introduced:
    /**
     * Force a user into a variation for a given experiment.
     *
     * @param $experimentKey string Key identifying the experiment.
     * @param $userId string The user ID to be used for bucketing.
     * @param $variationKey string The variation key specifies the variation which the user
     * will be forced into. If null, then clear the existing experiment-to-variation mapping.
     *
     * @return boolean A boolean value that indicates if the set completed successfully.
     */
    
    public function setForcedVariation($experimentKey, $userId, $variationKey);
    
    /**
     * Gets the forced variation for a given user and experiment.
     *
     * @param $experimentKey string Key identifying the experiment.
     * @param $userId string The user ID to be used for bucketing.
     *
     * @return string|null The forced variation key.
     */
    public function getForcedVariation($experimentKey, $userId);
    
    • Added the bucketing ID feature allows decoupling bucketing from user identification so that a group of users that have the same bucketing ID are put into the same variation.
    Open source →
  33. 1.2.0 22 May 2017
    Release notes
    • Add user profile service.
    Open source →
  34. 1.1.1 03 Apr 2017
    Release notes
    • Updated datafile parsing to be able to handle additional fields.
    Open source →
  35. 1.1.0 23 Mar 2017
    Release notes
    • Updated to send datafile revision information in log events.
    • Gracefully handle empty entity IDs.
    • Added event tags to track API to allow users to pass in event metadata.
    • Deprecated the eventValue parameter from the track method. Should use eventTags to pass in event value instead.
    • Relaxed restriction on monolog package.
    Open source →
  36. 1.0.1 14 Dec 2016
    Release notes
    • Updated to support more versions of json-schema package.
    Open source →
  37. 1.0.0 13 Dec 2016
    Release notes
    • General release of Optimizely X Full Stack PHP SDK. No breaking changes from previous version.
    • Introduced curl based event dispatcher.
    Open source →
  38. 0.1.0 28 Nov 2016
    Release notes
    • Beta release of the Optimizely X Full Stack PHP SDK.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive