Download the PHP package vwo/vwo-fme-php-sdk without Composer

On this page you can find all versions of the php package vwo/vwo-fme-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vwo-fme-php-sdk

VWO Feature Management and Experimentation SDK for PHP

Latest Stable Version CI Coverage StatusLicense

Overview

The VWO Feature Management and Experimentation SDK (VWO FME Php SDK) enables php developers to integrate feature flagging and experimentation into their applications. This SDK provides full control over feature rollout, A/B testing, and event tracking, allowing teams to manage features dynamically and gain insights into user behavior.

Requirements

Installation

Install the latest version with

Basic Usage Example

The following example demonstrates initializing the SDK with a VWO account ID and SDK key, setting a user context, checking if a feature flag is enabled, and tracking a custom event.

Advanced Configuration Options

To customize the SDK further, additional parameters can be passed to the init() API. Here's a table describing each option:

Parameter Description Required Type Example
sdkKey SDK key corresponding to the specific environment to initialize the VWO SDK Client. You can get this key from VWO Application. Yes string '32-alpha-numeric-sdk-key'
accountId VWO Account ID for authentication. Yes string '123456'
pollInterval Time interval for fetching updates from VWO servers (in milliseconds). No integer 60000
gatewayService An object representing configuration for integrating VWO Gateway Service. No array see Gateway section
storage Custom storage connector for persisting user decisions and campaign data. No array See Storage section
logger Toggle log levels for more insights or for debugging purposes. You can also customize your own transport in order to have better control over log messages. No array See Logger section

Refer to the official VWO documentation for additional parameter details.

User Context

The context array uniquely identifies users and is crucial for consistent feature rollouts. A typical context includes an id for identifying the user. It can also include other attributes that can be used for targeting and segmentation, such as customVariables, userAgent and ipAddress.

Parameters Table

The following table explains all the parameters in the context array:

Parameter Description Required Type Example
id Unique identifier for the user. Yes string 'unique_user_id'
customVariables Custom attributes for targeting. No array ['age' => 25, 'location' => 'US']
userAgent User agent string for identifying the user's browser and operating system. No string 'Mozilla/5.0 ... Safari/537.36'
ipAddress IP address of the user. No string '1.1.1.1'

Example

Basic Feature Flagging

Feature Flags serve as the foundation for all testing, personalization, and rollout rules within FME. To implement a feature flag, first use the getFlag API to retrieve the flag configuration. The getFlag API provides a simple way to check if a feature is enabled for a specific user and access its variables. It returns a feature flag object that contains methods for checking the feature's status and retrieving any associated variables.

Parameter Description Required Type Example
featureKey Unique identifier of the feature flag Yes string 'new_checkout'
context Array containing user identification and contextual information Yes array ['id' => 'user_123']

Example usage:

Custom Event Tracking

Feature flags can be enhanced with connected metrics to track key performance indicators (KPIs) for your features. These metrics help measure the effectiveness of your testing rules by comparing control versus variation performance, and evaluate the impact of personalization and rollout campaigns. Use the trackEvent API to track custom events like conversions, user interactions, and other important metrics:

Parameter Description Required Type Example
eventName Name of the event you want to track Yes string 'purchase_completed'
context Array containing user identification and contextual information Yes array ['id' => 'user_123']
eventProperties Additional properties/metadata associated with the event No array ['amount' => 49.99]

Example usage:

See Tracking Conversions documentation for more information.

Pushing Attributes

User attributes provide rich contextual information about users, enabling powerful personalization. The setAttribute method provides a simple way to associate these attributes with users in VWO for advanced segmentation. Here's what you need to know about the method parameters:

Parameter Description Required Type Example
attributeKey The unique identifier/name of the attribute you want to set Yes string 'plan_type'
attributeValue The value to be assigned to the attribute Yes string/int/boolean 'premium', 25, true
context Array containing user identification and contextual information Yes array ['id' => 'user_123']

Example usage:

Or

See Pushing Attributes documentation for additional information.

Polling Interval Adjustment

The pollInterval is an optional parameter that allows the SDK to automatically fetch and update settings from the VWO server at specified intervals. Setting this parameter ensures your application always uses the latest configuration.

Gateway

The VWO FME Gateway Service is an optional but powerful component that enhances VWO's Feature Management and Experimentation (FME) SDKs. It acts as a critical intermediary for pre-segmentation capabilities based on user location and user agent (UA). By deploying this service within your infrastructure, you benefit from minimal latency and strengthened security for all FME operations.

Why Use a Gateway?

The Gateway Service is required in the following scenarios:

How to Use the Gateway

The gateway can be customized by passing the gatewayService parameter in the init configuration.

Refer to the Gateway Documentation for further details.

Storage

The SDK operates in a stateless mode by default, meaning each getFlag call triggers a fresh evaluation of the flag against the current user context.

To optimize performance and maintain consistency, you can implement a custom storage mechanism by passing a storage parameter during initialization. This allows you to persist feature flag decisions in your preferred database system (like Redis, MongoDB, or any other data store).

Key benefits of implementing storage:

The storage mechanism ensures that once a decision is made for a user, it remains consistent even if campaign settings are modified in the VWO Application. This is particularly useful for maintaining a stable user experience during A/B tests and feature rollouts.

Logger

VWO by default logs all ERROR level messages to your server console. To gain more control over VWO's logging behaviour, you can use the logger parameter in the init configuration.

Parameter Description Required Type Example
level Log level to control verbosity of logs Yes string 'DEBUG'
prefix Custom prefix for log messages No string 'CUSTOM LOG PREFIX'
transport Custom logger implementation No array See example below

Example 1: Set log level to control verbosity of logs

Example 2: Add custom prefix to log messages for easier identification

Example 3: Implement custom transport to handle logs your way

The transport parameter allows you to implement custom logging behavior by providing your own logging functions. You can define handlers for different log levels (debug, info, warn, error, trace) to process log messages according to your needs.

For example, you could:

The transport object should implement handlers for the log levels you want to customize. Each handler receives the log message as a parameter.

For single transport you can use the transport parameter. For example:

For multiple transports you can use the transports parameter. For example:

Version History

The version history tracks changes, improvements, and bug fixes in each version. For a full history, see the CHANGELOG.md.

Development and Testing

  1. Set development environment

  2. Run test cases

Contributing

Please go through our contributing guidelines

Code of Conduct

Code of Conduct

License

Apache License, Version 2.0

Copyright 2024-2025 Wingify Software Pvt. Ltd.


All versions of vwo-fme-php-sdk with dependencies

PHP Build Version
Package Version
Requires ramsey/uuid Version ^3.0 || ^4.2
guzzlehttp/guzzle Version ^6.0 || ^7.8
lastguest/murmurhash Version ^2.1.1
vwo/vwo-fme-sdk-e2e-test-settings-n-cases Version ^1.2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vwo/vwo-fme-php-sdk contains the following files

Loading the files please wait ....