---
title: "Akamai CDN Integration Guide"
description: "This document describes how to apply Forensic Watermarking embedding with Akamai CDN."
---
> For the complete documentation index, see [llms.txt](/llms.txt).

This document describes how to apply Forensic Watermarking embedding with Akamai CDN which is pre-integrated with DoveRunner FWM.

:::caution[Two-party prerequisite — start both in parallel]
Akamai integration requires coordinating with **two** parties before you can go live, and both can take time:
1. **Akamai** — ask your Akamai account representative to add the watermarking behavior to your contract and activate it on your AMD (Adaptive Media Delivery) property.
2. **DoveRunner Helpdesk** — [contact us](https://support.doverunner.com) to obtain the Akamai `token signing` and `pattern encryption` cert key values required for your property configuration. Integration will fail with error `A5001` (Akamai cert key not registered) until this key is registered on our side.

Start both requests as early as possible — completing only one side will block the integration.
:::

Session URLs for Akamai **must** use `wmt_type: "jwt"` (not the default `aes`) when calling the Session Manager API — see [Choosing wmt_type](../session-manager/#supported-integration-specification). Using `aes` by mistake will not produce watermark-embedded playback and does not surface an obvious error.

## Integration Workflow
```mermaid
%%{init: {
  "theme": "default",
  "themeVariables": {
    "fontSize": 40,
    "actorFontSize": 40,
    "noteFontSize": 28,
    "messageFontSize": 28
  },
  "themeCSS": "
    .messageLine0,
    .messageLine1,
    .messageLine2,
    .messageLine3,
    .messageLine4,
    .messageLine5,
    .messageLine6,
    .messageLine7,
    .messageLine8,
    .messageLine9,
    .messageLine10,
    .messageLine11 {
      stroke: #FFD700 !important;
    }

    .messageText {
      fill: #FFD700 !important;
    }

    .arrowheadPath {
      fill: #FFD700 !important;
      stroke: #FFD700 !important;
    }
  "
}}%%
sequenceDiagram
  autonumber
  participant Player as Client Player
  participant CMS as Service Backend (CMS)
  participant DRSM as DoveRunner Session Manager
  participant Akamai as Akamai Edge
  participant Origin as Origin Server

  Note over CMS,DRSM: 1) Request a watermarked stream URL
  CMS->>DRSM: Request watermarked stream URL<br/>Stream info<br/>Session data (User ID, IP, Timestamp)
  DRSM->>DRSM: Store session data
  DRSM->>DRSM: Generate Watermark Token (WMT)

  Note over DRSM,CMS: 2) Return stream URL with WMT (VPC)
  DRSM-->>CMS: Watermarked stream URL<br/>(WMT embedded as Virtual Path Component)

  Note over CMS,Player: 3) Provide URL to start playback
  CMS-->>Player: Stream URL including WMT

  Note over Player,Akamai: 4) Playback and watermark embedding at edge
  Player->>Akamai: Request stream segments (URL includes WMT)
  Akamai->>Akamai: Decode WMT / watermarking pattern
  Akamai->>Origin: Fetch A/B variant segments
  Origin-->>Akamai: A/B variant segments
  Akamai-->>Player: Mixed watermark-embedded stream segments

  Note over Player: Client plays stream normally

```

Watermarked Session Flow with DoveRunner

1. Send session data to DoveRunner Session Manager

&nbsp;&nbsp;&nbsp;&nbsp; During player configuration, the service backend (CMS) requests a watermarked stream URL from the DoveRunner Session Manager using the Session Manager API.

&ensp;&thinsp; This request includes:
- Stream information
- Client session details such as user ID, IP address, and timestamp

2. Store session data and generate watermark token
  - The DoveRunner Session Manager securely stores the received session data and generates a Watermark Token (WMT) associated with that session.

3. Generate a stream URL with the watermark token
  - The Session Manager creates the watermarked stream URL by including the WMT as a `virtual path component (VPC)` of the stream.
  - Please refer to [this guide](https://techdocs.akamai.com/adaptive-media-delivery/docs/add-wmk) from Akamai for more details.

4. Provide the watermarked stream URL to the client player
 - The watermarked stream URL (including the WMT) is returned to the service backend and then passed to the client player to initiate playback.

5. Watermark embedding and playback
- At playback time, the Akamai edge dynamically mixes A/B variant streams from the origin server based on the watermarking pattern encoded in the WMT.
- The client player plays the watermark-embedded stream exactly like a standard, non-watermarked stream, with no impact on playback behavior or user experience.


## Akamai CDN Integration Process


If you use Akamai CDN for content delivery, you can utilize the pre-integrated `Akamai Adaptive Media Delivery` interface with DoveRunner Forensic Watermarking or utilize the new Edge Worker [service](https://techdocs.akamai.com/edgeworkers/docs/welcome-to-edgeworkers) 

Procedure for `Akamai Adaptive Media Delivery` (AMD):
1. Ask to your Akamai account representative to get the watermarking behavior added to your contract.

2. Contact DoveRunner team to get the `token signing` and `pattern encryption` values required for the below configuration.

3. Add the watermarking behavior in your Akamai property configuration as described [here](https://techdocs.akamai.com/adaptive-media-delivery/docs/set-up-watermarking-in-your-amd-property).

Procedure for `Akamai EdgeWorkers` :

1. Akamai Edge worker supports Javascript execution similar to AWS Lambda Edge.

2. Please refer to this [link](https://techdocs.akamai.com/edgeworkers/docs/watermarking) and sample [code](https://github.com/akamai/edgeworkers-examples/tree/master/delivery/media)

3. You may use the Doverunner sample code available at this [link](https://github.com/doverunner/fwm-cdn-embedder-edgeworkers)

:::note 

Akamai EdgeWorkers Watermarking works on a similar specification to AMD Watermarking. AB filename patterns, startNumber, etc. are not publicly available, but are fixed as "directory prefix" and "start from 0" in the source code.
However, EdgeWorkers Watermarking is open source code and does not explicitly license individual modules, but the top-level license of the GitHub project is the Apache License 2.0, so you can add or modify the necessary content and use it.

:::

:::note 

Fastly CDN integration requires a similar preparation process as Akamai. If you need detailed information on Fastly CDN integration, please contact us via Helpdesk.

:::