Node.js
Best Practices
Best Practices Initialise once, at startup The SDK should be initialised before your server starts handling requests. This avoids race conditions where an experiment evaluation runs before the client is ready. const pageSenseClient = await ...
SDK Customisation
All SDK configuration goes through the PageSenseSDKOptions object. Pass it in at initialization to control logging, polling frequency, and user storage behaviour. Initialization with Custom Options const sdkOptions = new PageSenseSDKOptions() ...
Syncing Project Settings
Why this matters The PageSense SDK works off a local copy of your project settings. When you update an experiment — change a variation, adjust traffic, modify targeting rules — the SDK needs to pick up those changes. getAndUpdateProjectSettings does ...
Initializing the PageSense Node.js SDK
Before you start PageSenseClient is the core interface for running experiments. Everything — activating experiments, tracking goals, evaluating variations — runs through this client. You need to initialise it once before any of that works. ...
Installing the PageSense Node.js SDK
Installation The SDK is on npm. Run this in your project root: npm install @zohopagesense/pagesense-node-sdk That's it. The SDK is added to node_modules and your package.json is updated automatically. Your package.json will include: json { ...
PageSense Node.js SDK — Overview
What is FullStack A/B Testing? Most A/B testing happens in the UI — swap a button color, test a headline. FullStack A/B testing goes deeper. It lets you run experiments directly in your application code: backend logic, APIs, pricing models, ...