---
title: Akamai EdgeWorkers
slug: feature-experimentation/docs/akamai-edgeworkers
createdAt: 2026-08-05T20:39:58.000Z
---

The [Akamai EdgeWorkers](https://techdocs.akamai.com/edgeworkers/docs/welcome-to-edgeworkers) service makes it possible to deploy JavaScript functions at the edge and create customized experiences for your website visitors.

## Advantages of Akamai EdgeWorkers

- **Innovation** – Development teams can freely build logic safeguarded against unwanted usage through security protections provided by Akamai.
- **Improved time to market** – Developers can manage Akamai and deliver their code in JavaScript without learning a new, proprietary language.
- **Logic is executed close to users** – Code is sent across the world's largest distributed network, the Akamai Edge.
- **Decreased overhead at origin** – Developers can create code and not worry about internal infrastructure or increased traffic at the origin.

### Akamai EdgeWorkers use cases

EdgeWorkers let you write and deploy JavaScript functions at the edge. For use cases, refer to the [EdgeWorkers documentation](https://techdocs.akamai.com/edgeworkers/docs/use-cases).

### Restrictions and limitations

There are various restrictions and limitations to EdgeWorkers to note when running feature flags and experiments. Refer to the [official Akamai documentation](https://techdocs.akamai.com/edgeworkers/docs/limitations) for the most recent product limits and specific resource tier limitations. Also, review the [known issues with EdgeWorkers](https://techdocs.akamai.com/edgeworkers/docs/known-issues).

## Optimizely + Akamai EdgeWorkers starter kit

This starter kit for Akamai's Edge Workers embeds and extends the [JavaScript Node SDK](docId:5-xFjwBwxerduQk4iUDN1) 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 more generally, this can be combined with the steps outlined in the [JavaScript SDK Quickstart](docId\:V_QSL9bCRG2dbqgpFuMwa).

### Identity management

Optimizely's Feature Experimentation SDKs require [passing a user-provided identifier at runtime ](docId\:j0PPoMJWYbz04K76EKLUI) 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](docId\:g0ydY7XzuuT9yqJzZgZuG). 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.

### How bucketing works

See [How bucketing works](docId\:d31cP4wLKZws83yx-R50O) for information on how the SDKs assign users to feature flags and experiments.

## How to use

### Prerequisites

You must have these prerequisites to use this starter kit:

- An Optimizely account. If you do not have an account, you can [register for a free account](https://www.optimizely.com/products/intelligence/full-stack-experimentation/).
- An Akamai account with [EdgeWorkers added to your contract](https://techdocs.akamai.com/edgeworkers/docs/add-edgeworkers-to-contract).
- The [Akamai CLI](https://developer.akamai.com/getting-started/cli).

### Get started

1. Create an [EdgeWorker ID](https://techdocs.akamai.com/edgeworkers/docs/create-an-edgeworker-id-1).
2. Add the [EdgeWorker Behavior](https://techdocs.akamai.com/edgeworkers/docs/add-the-edgeworker-behavior-1).
3. Install the [Akamai CLI](https://developer.akamai.com/getting-started/cli).
4. Install the [EdgeWorkers CLI](https://techdocs.akamai.com/edgeworkers/docs/akamai-cli#edgeworkers-cli).

```shell
akamai install edgeworkers
```

1. Configure Akamai [Authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials).
2. Create a folder and download the [Optimizely and Akamai Edgeworkers starter kit code from GitHub](https://github.com/optimizely/akamai-edgeworker-starter-kit) for the starter kit into it.

```shell
curl -L https://github.com/optimizely/akamai-edgeworker-starter-kit/tarball/main | tar --strip-components=1 -zx
```

```shell
wget --no-check-certificate https://github.com/optimizely/akamai-edgeworker-starter-kit/tarball/main -O - | tar --strip-components=1 -zx
```

1. Install the node modules.

```shell
npm install
```

1. Add your SDK key and flag in `src/main.js`. Your SDK keys are in the Optimizely application under **Settings**.
2. Build the bundle.

```shell
npm run build
```

1. Upload the bundle.

```shell
akamai edgeworkers upload --bundle="dist/bundle.tgz" {WORKER_ID}
```

1. Activate the version.

```shell
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 in `bundle.json`. This should be updated on every deployment.

12. Enable [Advanced debug headers](https://techdocs.akamai.com/edgeworkers/docs/enable-enhanced-debug-headers) to receive debug logs in the response headers.

## Additional resources

- [Akamai EdgeWorkers](https://developer.akamai.com/akamai-edgeworkers-overview).
- [Akamai EdgeWorkers official documentation](https://techdocs.akamai.com/edgeworkers/docs/welcome-to-edgeworkers).
- [Akamai EdgeWorkers getting started documentation](https://techdocs.akamai.com/edgeworkers/docs/hello-world-edgeworkers-management-application).
- [Akamai EdgeWorkers with Optimizely GitHub](https://github.com/optimizely/akamai-edgeworker-starter-kit).
