Experimentation Lab
Interactive implementation reference
Feature SDK implementation

JavaScript Node v5

The pre-v6 Node-specific integration for existing server applications.

Node.js · legacy
This runtime cannot execute inside a Next.js browser process. The page shows the native, official SDK shape; use the JavaScript, React, or Next.js pages for a live decision and event round trip with the same project, flag, event, and visitor ID.

Implementation

Official docs ↗
npm install @optimizely/optimizely-sdk@5
const optimizely = createInstance({ sdkKey: process.env.OPTIMIZELY_SDK_KEY });
await optimizely.onReady();
const decision = optimizely.createUserContext(userId).decide('demo_flag');