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 License

CI codecov

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'
gatewayService An object representing configuration for integrating VWO Gateway Service. No array see Gateway section
proxy An object representing configuration for routing all SDK network requests through a custom proxy server. No array See Proxy 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
integrations Callback function for integrating with third-party analytics services. No object See Integrations 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'
bucketingSeed Custom seed for bucketing logic instead of user ID. No string 'custom_seed_value'

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.

Generating UUID

The getUUID method allows you to generate a UUID that gets stored on VWO by providing a userId and accountId. This UUID is generated using a deterministic algorithm based on the user and account identifiers, ensuring consistent UUID generation for the same user-account combination.

Parameter Description Required Type Example
userId The unique identifier for the user Yes String 'user-123'
accountId The account ID Yes String '123456'

Return Value

Returns a UUID string formatted without dashes and in uppercase (e.g., 'CC25A368ADA0542699EAD62489811105').

Example Usage

Custom Bucketing Seed

By default, the SDK uses the user's id to determine which variation or feature a user is bucketed into. The bucketingSeed parameter lets you override this behavior by providing a custom string for bucketing calculations.

This is useful when you want to:

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.

Proxy

The proxy parameter allows you to redirect all SDK network calls through a custom proxy URL. This feature enables you to route all SDK network requests (settings, tracking, etc.) through your own proxy server, providing better control over network traffic and security.

The proxy object accepts the following parameters:

Parameter Description Required Type Example
url The proxy server URL to route all SDK network requests through Yes string 'http://localhost:8000'
isUrlNotSecure Set to true if the proxy URL uses HTTP (not HTTPS). Defaults to false (HTTPS) No boolean true

Synchronous network calls

Synchronous network calls differ from the default (asynchronous or fire-and-forget) tracking behavior by waiting for the tracking request to return a response from the VWO server before proceeding with the rest of your application code. By default, the SDK sends tracking network calls in a way that does not block your application, providing maximum throughput and lowest latency for user actions.

Why is it so?

When should you use synchronous calls?

You can opt-in to perform network calls synchronously by passing an init parameter.

Notes:

If you want synchronous calls but without retries, set shouldRetry to false:

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'
isAnsiColorEnabled Enable ANSI color codes for log levels in terminal output No boolean true
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: Enable ANSI color codes for colored log levels in terminal

Note: ANSI color codes are only applied when isAnsiColorEnabled is explicitly set to true. This prevents unwanted color codes in log files or non-terminal outputs. When disabled or not set, log levels are displayed as plain text.

Example 4: 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:

Integrations

VWO FME SDKs provide seamless integration with third-party tools like analytics platforms, monitoring services, customer data platforms (CDPs), and messaging systems. This is achieved through a simple yet powerful callback mechanism that receives VWO-specific properties and can forward them to any third-party tool of your choice.

User Aliasing

User aliasing lets you associate an existing user ID with an alternate ID (alias) so future evaluations and tracking use a unified identity across systems.

Requirements:

Initialization example:

Usage examples:

Behavior and validations:

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-2026 Wingify Software Pvt. Ltd.


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

PHP Build Version
Package Version
Requires wingify/wingify-fme-php-sdk Version ^2.11.0
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 ...