Launch

The VWO client class needs to be instantiated as an instance that exposes various API methods like activate, getVariationName and track.

Each VWO client represents the state of a project corresponding to the settingsFile. SettingsFile needs to be fetched before instantiating a VWO client. Read more on how to get SettingsFile.

API Description

SDK provides a method to instantiate a VWO client as an instance. The method accepts an object to configure the VWO client.

The only required parameter for instantiating the SDK is settingsFile. There are other optional parameters, which you could provide for overriding the default behavior or setting environment. Refer to Customize an SDK for more information.

Parameter Definitions

Below is the list of all parameters that can be used for configuring the VWO SDK.

ParameterTypeDescription
settingsFile
Required
ObjectThe JSON representing your project and the campaign settings.
isDevelopmentMode
Optional
BooleanFlag for experimenting the SDK on test-app/staging so that no impression is sent to the VWO server for tracking.
userStorageService
Optional
ObjectThe JSON representing the User Campaign Data Map. Used for sticky bucketing and deciding when to call Activate API vs. getVariationName API.
logging
Optional
ObjectOverride default logger behaviour. Customise log-level, and implement your own log message.
goalTypeToTrack
Optional
StringIf you want to track a particular goal across multiple campaigns(having the same identifier), use this flag to define which type of goal you would like to track i.e. conversion-only or revenue-only, or both. Defaults to ALL i.e. Conversion as well as Revenue goals.

Note: This is currently supported in Node.js, Python, Java, and .NET SDKs only from v1.8.0+ onwards
shouldTrackReturningUser
Optional
BooleanCalling track APIs with same user ID will track that user multiple times in the campaign reports. Pass a true value to track only unique conversions of a particular user. This is applicable only if you've implemented a User Storage Service at your end.

Note: This is currently supported in NodeJs, Python, Java, and .NET SDKs only from v1.8.0+ onwards

Returns

Instantiates an instance of the VWO class, which can be referenced later for calling out different API methods.

Usage

var vwoSDK = require('vwo-node-sdk');

var vwoClientInstance = vwoSDK.launch({
  settingsFile: settingsFile
});
<?php

require_once('vendor/autoload.php');

use vwo\VWO;

$vwoClientInstance = new VWO($config);
import vwo

settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(settings_file)
using VWOSdk;

Settings settingsFile = VWO.GetSettings(accountId, sdkKey);
IVWOClient vwoClientInstance = VWO.Launch(settingsFile);
import com.vwo.VWO;

String settingsFile = VWO.getSettingsFile(accountId, sdkKey);
VWO vwoClientInstance = VWO.launch(settingsFile).build();
require 'vwo'

vwo_client_instance = VWO.new(config['account_id'], config['sdk_key'], nil, nil, false)
import vwo "github.com/wingify/vwo-go-sdk"
import "github.com/wingify/vwo-go-sdk/pkg/api"

// Get SettingsFile
settingsFile := vwo.GetSettingsFile("accountID", "SDKKey")

// Default instance of VwoInstance
vwoClientInstance, err := vwo.Launch(settingsFile)
if err != nil {
	//handle err
}

// Instance with custom options
vwoClientInstance, err := vwo.Launch(settingsFile, api.WithDevelopmentMode())
if err != nil {
	//handle err
}