HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Install SDK

This topic describes the steps necessary to install the Optimizely JavaScript (Browser) SDK into your application.

The JavaScript SDK can be used in browser and is distributed through:

  • npm
  • yarn
  • a prebuilt UMD bundle of the JavaScript SDK, which allows installing the SDK via an HTML .
npm install --save @optimizely/optimizely-sdk
yarn add @optimizely/optimizely-sdk
<script src="https://unpkg.com/@optimizely/optimizely-sdk/dist/optimizely.browser.umd.min.js"></script>

🚧

Note

We do not recommend using the unpkg script tag installation method in production as it introduces a third-party performance dependency, and will not be explicitly version-locked by default

The full source code is at https://github.com/optimizely/javascript-sdk/tree/master/packages/optimizely-sdk.

Requirements

The JavaScript SDK requires an ES5-compatible environment, as well as Promise. To run in environments that don't support Promise, you can use promise-polyfill.

Next

After installing, you need to intialize the SDK.


Did this page help you?