{"id":14317,"library":"vwo-node-sdk","title":"VWO Node.js SDK","description":"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.","status":"deprecated","version":"1.73.0","language":"javascript","source_language":"en","source_url":"https://github.com/wingify/vwo-node-sdk","tags":["javascript","typescript"],"install":[{"cmd":"npm install vwo-node-sdk","lang":"bash","label":"npm"},{"cmd":"yarn add vwo-node-sdk","lang":"bash","label":"yarn"},{"cmd":"pnpm add vwo-node-sdk","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS `require` is the primary usage pattern shown in documentation and examples, though ESM `import` is generally supported in modern Node.js environments.","wrong":"const VWO = require('vwo-node-sdk');","symbol":"VWO","correct":"import VWO from 'vwo-node-sdk';"},{"note":"The `init` method is a static factory method on the VWO module, not a constructor or direct invocation.","wrong":"const vwoClient = VWO({settingsFile: settingsFile});","symbol":"VWO.init","correct":"const vwoClient = VWO.init(settingsFile);"},{"note":"The `getSettingsFile` method is a static method on the VWO module itself, typically called before initializing the VWO client instance.","wrong":"const settingsFile = await vwoClient.getSettingsFile(accountId, sdkKey);","symbol":"VWO.getSettingsFile","correct":"const settingsFile = await VWO.getSettingsFile(accountId, sdkKey);"}],"quickstart":{"code":"import VWO from 'vwo-node-sdk';\n\nconst accountId = process.env.VWO_ACCOUNT_ID ?? '';\nconst sdkKey = process.env.VWO_SDK_KEY ?? '';\nconst userId = 'user_id_123';\nconst campaignKey = 'your-campaign-key';\nconst goalIdentifier = 'your-goal-identifier';\n\nasync function runVWOExperiment() {\n  if (!accountId || !sdkKey) {\n    console.error('VWO_ACCOUNT_ID and VWO_SDK_KEY environment variables must be set.');\n    return;\n  }\n\n  try {\n    // Get the latest settings file (can include proxyUrl option since v1.73.0)\n    const settingsFile = await VWO.getSettingsFile(accountId, sdkKey, null, { proxyUrl: process.env.VWO_PROXY_URL ?? undefined });\n\n    // Initialize the VWO client\n    const vwoClient = VWO.init(settingsFile);\n\n    // Check if the user is part of the campaign and get variation\n    const variation = vwoClient.activate(campaignKey, userId);\n\n    if (variation) {\n      console.log(`User ${userId} is part of campaign ${campaignKey} and got variation: ${variation}`);\n      // Track a goal conversion\n      vwoClient.track(campaignKey, userId, goalIdentifier);\n      console.log(`Goal '${goalIdentifier}' tracked for user ${userId} in campaign ${campaignKey}.`);\n    } else {\n      console.log(`User ${userId} is not eligible for campaign ${campaignKey}.`);\n    }\n  } catch (error) {\n    console.error('Error running VWO experiment:', error.message);\n  }\n}\n\nrunVWOExperiment();","lang":"typescript","description":"This code demonstrates how to initialize the VWO SDK, fetch settings, activate a user in a campaign, and track a goal conversion."},"warnings":[{"fix":"Migrate to VWO Feature Management & Experimentation (FME) product for continued support and new features. Refer to VWO's official migration guide.","message":"This 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.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade to v1.72.0 or higher to benefit from the built-in retry mechanism. Implement robust error handling around `VWO.getSettingsFile`.","message":"The 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.","severity":"gotcha","affected_versions":"<1.72.0"},{"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.","message":"When 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.","severity":"gotcha","affected_versions":"<1.73.0"},{"fix":"Upgrade to v1.71.0 or newer to ensure correct TypeScript definitions for integration callbacks.","message":"TypeScript 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.","severity":"gotcha","affected_versions":"<1.71.0"}],"env_vars":null,"search_vec":"'1.73.0':10 'a/b':17 'activ':28,62 'ad':119 'ad-block':118 'allow':21 'also':40 'applic':37 'blocker':120 'bug':73 'bypass':117 'call':101 'capabl':12 'client':45 'client-sid':44 'critic':72 'current':8,52 'deprec':55 'develop':22,63,89 'enhanc':68 'environ':48 'experi':27 'experiment':20,84 'featur':25,32,66,82,94 'fix':76 'fme':85 'goal':29 'http':100 'implement':24 'includ':95 'javascript':47,124 'like':26 'longer':61 'manag':83 'mean':57 'mechan':98 'migrat':79 'network':110 'new':65 'node.js':2,6,36 'ongo':88 'packag':93 'product':86 'provid':11 'proxi':108 'receiv':71 'recommend':78 'request':111 'retri':97 'rout':122 'sdk':3,7,50 'secur':75 'server':15 'server-sid':14 'side':16,46 'status':56 'support':91,106 'test':18 'toggl':33 'track':30 'traffic':123 'typescript':125 'use':42,115 'v1.73.0':105 'version':9 'vwo':1,5,77 'within':34","created_at":"2026-04-20T01:59:05.063245+00:00","updated_at":"2026-04-20T01:59:05.063245+00:00","problems":[{"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')`.","cause":"Attempting to call 'init' on an already initialized VWO client instance or incorrectly importing the module.","error":"TypeError: VWO.init is not a function"},{"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`.","cause":"The VWO account ID or SDK key was not provided or was empty during the `getSettingsFile` call.","error":"Error running VWO experiment: accountId and sdkKey are required"},{"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`.","cause":"The SDK failed to retrieve the settings file from VWO servers due to network issues, incorrect SDK key, or firewall/proxy restrictions.","error":"UnhandledPromiseRejectionWarning: Error: Network error fetching settings file"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://vwo.com","github":"https://github.com/wingify/vwo-node-sdk","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vwo-node-sdk","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","http-networking","aws","gcp","azure"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}