Registry / testing / vwo-node-sdk

vwo-node-sdk

JSON →
library1.73.0jsnpmunverified

The VWO Node.js SDK (current version 1.73.0) provides capabilities for server-side A/B testing and experimentation, allowing developers to implement features like experiment activation, goal tracking, and feature toggles within their Node.js applications. It can also be used for client-side JavaScript environments. This SDK is currently in a deprecated status, meaning it is no longer actively developed for new features or enhancements; it only receives critical bug and security fixes. VWO recommends migrating to their 'Feature Management & Experimentation (FME)' product for ongoing development and support. The package features include a retry mechanism for HTTP calls and, as of v1.73.0, support for proxying all network requests, which can be useful for bypassing ad-blockers or routing traffic.

npm install vwo-node-sdk
INSTALL
IMPORT
SIG · VWO-NODE-SDK
V
vwo-node-sdk
testingjavascriptv1.73.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VWO
import VWO from 'vwo-node-sdk';
const VWO = require('vwo-node-sdk');
CommonJS `require` is the primary usage pattern shown in documentation and examples, though ESM `import` is generally supported in modern Node.js environments.
VWO.init
const vwoClient = VWO.init(settingsFile);
const vwoClient = VWO({settingsFile: settingsFile});
The `init` method is a static factory method on the VWO module, not a constructor or direct invocation.
VWO.getSettingsFile
const settingsFile = await VWO.getSettingsFile(accountId, sdkKey);
const settingsFile = await vwoClient.getSettingsFile(accountId, sdkKey);
The `getSettingsFile` method is a static method on the VWO module itself, typically called before initializing the VWO client instance.

This code demonstrates how to initialize the VWO SDK, fetch settings, activate a user in a campaign, and track a goal conversion.

import VWO from 'vwo-node-sdk'; const accountId = process.env.VWO_ACCOUNT_ID ?? ''; const sdkKey = process.env.VWO_SDK_KEY ?? ''; const userId = 'user_id_123'; const campaignKey = 'your-campaign-key'; const goalIdentifier = 'your-goal-identifier'; async function runVWOExperiment() { if (!accountId || !sdkKey) { console.error('VWO_ACCOUNT_ID and VWO_SDK_KEY environment variables must be set.'); return; } try { // Get the latest settings file (can include proxyUrl option since v1.73.0) const settingsFile = await VWO.getSettingsFile(accountId, sdkKey, null, { proxyUrl: process.env.VWO_PROXY_URL ?? undefined }); // Initialize the VWO client const vwoClient = VWO.init(settingsFile); // Check if the user is part of the campaign and get variation const variation = vwoClient.activate(campaignKey, userId); if (variation) { console.log(`User ${userId} is part of campaign ${campaignKey} and got variation: ${variation}`); // Track a goal conversion vwoClient.track(campaignKey, userId, goalIdentifier); console.log(`Goal '${goalIdentifier}' tracked for user ${userId} in campaign ${campaignKey}.`); } else { console.log(`User ${userId} is not eligible for campaign ${campaignKey}.`); } } catch (error) { console.error('Error running VWO experiment:', error.message); } } runVWOExperiment();
Debug
Known issues
breakingThis SDK is officially DEPRECATED. It is no longer actively developed for new features, enhancements, or non-critical updates. Only critical bugs and security issues will be fixed.
fix
Migrate to VWO Feature Management & Experimentation (FME) product for continued support and new features. Refer to VWO's official migration guide.
affects: >=1.0.0
gotchaThe SDK relies on network calls to fetch settings files. If these calls fail, experiments might not load correctly. Version 1.72.0 introduced a retry mechanism for HTTP calls to improve resilience.
fix
Upgrade to v1.72.0 or higher to benefit from the built-in retry mechanism. Implement robust error handling around `VWO.getSettingsFile`.
affects: <1.72.0
gotchaWhen running in environments with ad-blockers or strict network policies, VWO's default network requests (for settings, tracking) might be blocked. Version 1.73.0 added support for routing all network calls through a custom proxy URL.
fix
Upgrade to v1.73.0 and configure the `proxyUrl` option in `VWO.getSettingsFile` to route traffic through a controlled proxy server if experiencing network blocking issues.
affects: <1.73.0
gotchaTypeScript definition files for integrations callbacks were missing in versions prior to 1.71.0, leading to type errors or incomplete autocompletion when using the SDK with TypeScript.
fix
Upgrade to v1.71.0 or newer to ensure correct TypeScript definitions for integration callbacks.
affects: <1.71.0
Errors
Common errors & fixes
TypeError: VWO.init is not a function
Attempting to call 'init' on an already initialized VWO client instance or incorrectly importing the module.
fix
Ensure `VWO.init` is called directly on the imported module (e.g., `const vwoClient = VWO.init(settings);`) and not on a `vwoClient` instance itself. Confirm you are using `import VWO from 'vwo-node-sdk'` or `const VWO = require('vwo-node-sdk')`.
Error running VWO experiment: accountId and sdkKey are required
The VWO account ID or SDK key was not provided or was empty during the `getSettingsFile` call.
fix
Verify that `VWO_ACCOUNT_ID` and `VWO_SDK_KEY` environment variables (or direct parameters) are correctly set and non-empty when calling `VWO.getSettingsFile`.
UnhandledPromiseRejectionWarning: Error: Network error fetching settings file
The SDK failed to retrieve the settings file from VWO servers due to network issues, incorrect SDK key, or firewall/proxy restrictions.
fix
Check network connectivity, verify `accountId` and `sdkKey`. If running behind a proxy or with ad-blockers, consider upgrading to v1.73.0 and utilizing the `proxyUrl` option in `getSettingsFile`.
Upgrade
Version history
1.73.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
46 hits · last 30 days
node
40
OpenAI (training)
3
Resources
vwo-node-sdk — npm install vwo-node-sdk · libregistry