Optimizely Full Stack is a feature flagging and experimentation platform for websites, mobile apps, chatbots, APIs, smart devices, and anything else with a network connection.
You can deploy code behind feature flags, experiment with A/B tests, and roll out or roll back features immediately. All of this functionality is available with minimal performance impact through easy-to-use, open source SDKs.
Starter Kit for running Optimizely Full Stack feature flags and experiments on the Akamai EdgeWorkers service.
The Optimizely starter kit for Akamai's EdgeWorkers embeds and extends our Javascript Node SDK to provide a starting point for you to implement experimentation and feature flagging for your experiences at the edge. For a guide to getting started with our platform more generally, this can be combined with the steps outlined in our Javascript Quickstart.
Out of the box, Optimizely's Full Stack SDKs require a user-provided identifier to be passed in at runtime to drive experiment and feature flag decisions. This example generates a unique ID, stores it in a cookie and reuses it to make the decisions sticky. Alternatively, you can use an existing unique identifier available within your application and pass it in as the value for the OPTIMIZELY_USER_ID
cookie.
For more information on how Optimizely Full Stack SDKs assign users to feature flags and experiments, see the documentation on how bucketing works.
You will need have Optimizely account before following this starter kit. If you do not have an account, you can register for a free account.
-
Create an EdgeWorker ID.
-
Add the EdgeWorker Behavior.
-
Install the Akamai CLI.
-
Install the EdgeWorkers CLI.
akamai install edgeworkers
-
Setup Authentication credentials.
-
Create a new folder and pull the code from this Starter kit.
curl -L https://github.com/optimizely/akamai-edgeworker-starter-kit/tarball/main | tar --strip-components=1 -zx
or
wget --no-check-certificate https://github.com/optimizely/akamai-edgeworker-starter-kit/tarball/main -O - | tar --strip-components=1 -zx
-
Install node modules.
npm install
-
Add your Optimizely SDK key and flag in src/main.js. Your SDK keys can be found in the Optimizely application under Settings.
-
Build the bundle.
npm run build
-
Upload the bundle
akamai edgeworkers upload --bundle="dist/bundle.tgz" {WORKER_ID}
-
Activate the version
akamai edgeworkers activate {WORKER_ID} {ENVIRONMENT} {EDGEWORKER_VERSION}
WORKER_ID
: Unique ID for your EdgeWorker. This can be obtained from the Akamai control center.
ENVIRONMENT
: The environment the EdgeWorker is being deployed on.
EDGEWORKER_VERSION
: The custom version of the EdgeWorker as mentioned inbundle.json
. This should be updated on every new deployment. -
Enable Advanced debug headers to receive debug logs in the response headers.
Please see CONTRIBUTING.