---
title: "CDN Embedder with CDNetworks Edge Application"
description: "This guide explains how to configure and deploy the Doverunner CDN Embedder using CDNetworks Edge Application."
---
> For the complete documentation index, see [llms.txt](https://docs.doverunner.com/llms.txt).

The CDN Embedder leverages CDNetworks Edge Application to deliver forensically watermarked content through a content delivery network. 
This guide walks you through configuring and deploying the embedder for your Doverunner Forensic Watermarking implementation.

Sample code is available on GitHub.
[CDNetworks Embedder sample](https://github.com/doverunner/fwm-cdn-embedder-cdnetworks-edge-application)

The CDN Embedder is responsible for:
- Validating watermark tokens issued by the **Session Manager**  
- Resolving the correct **watermark file path** (based on user/session/variant)  
- Fetching files from the origin of your CDN domain and serving them through the domain  

Configuration is primarily done through:
- `config.js` – Watermark token and folder structure configuration  

## Configuration

#### Source Configuration (`config.js`)

Begin by updating your `config.js` file with the appropriate settings for your deployment:

```javascript
export const config = {
  "aesKey": "YOUR_DOVERUNER_SITE_KEY",
  "type": "unlabeled_a_variant",
  "availableInterval": 60,
  "prefixFolder": ["folder1", "folder2"],
  "wmtPublicKey": "YOUR_PUBLIC_KEY", // PEM format public key for Akamai WMT
  "wmtPassword": "YOUR_PASSWORD" // Password for WMT token generation/verification
}
```

#### Configuration Parameters

| Parameter | Token Type | Description |
|-----------|------------|-------------|
| `aesKey` | AES | The Site Key issued by Doverunner ContentSecurity Service |
| `type` | AES, JWT | Watermark token request specification type. Default: `unlabeled_a_variant` |
| `availableInterval` | AES | Token validity period in minutes (set to `0` for unlimited validity) |
| `prefixFolder` | AES | Array of top-level folders containing watermarked files. Corresponds to `prefix_folder` in the watermark token request specification |
| `wmtPublicKey` | JWT | PEM-formatted public key for Akamai WMT integration |
| `wmtPassword` | JWT | Password credential for WMT token generation and verification |

:::info
The `wmt_type` parameter determines whether your watermark tokens use AES encryption or JWT format. This must align with the specification provided when requesting watermark tokens from Doverunner.
:::

## Deployment

### Prerequisites

Before proceeding with deployment, ensure you have:

- An active CDNetworks account with Edge Application enabled
- A CDN domain whose origin stores the watermarked content
- Node.js and npm installed on your development machine

### Step 1: Build the Function

Edge Application takes the function as a single `index.js` file. Build it in the sample directory:

```bash
npm install
npm run bundle
```

This command writes the bundled function to `dist/index.js`. The same bundle is also attached to each [GitHub release](https://github.com/doverunner/fwm-cdn-embedder-cdnetworks-edge-application/releases/latest) as a zip file. If you use it, set your values in the `config` object at the top of its `index.js`.

### Step 2: Create the Function

1. In **Edge Application** > **Function List**, create a function without a template.
2. In CloudIDE, replace `index.js` with the bundled `index.js`.
3. Click **save and test** to commit the code.

### Step 3: Deploy and Add a Trigger

1. Deploy the function from **Grayscale Deployment**, and check that the version in the deployment record has changed.
2. In **Trigger List** > **Add**, select your domain, add a path condition for your watermark folders (e.g. `/wm-contents/*`), and select the function.

## Watermark File Folder Structure

Organize your watermarked content on the origin of your CDN domain according to the folder structure specified in the `prefixFolder` configuration parameter. The top-level folders should correspond to the `prefix_folder` values defined in your watermark token request specification.

## Additional Resources

- [CDNetworks Edge Application Documentation](https://documents.cdnetworks.com/document/edgeapplication/ea-overview)
- [Add Triggers](https://documents.cdnetworks.com/document/edgeapplication/add-triggers)
- [Doverunner Forensic Watermarking Embedding Documentation](https://docs.doverunner.com/content-security/forensic-watermarking/embedding/)

## Support

For additional assistance with CDN Embedder configuration or deployment, please [contact Doverunner support](https://support.doverunner.com/) or consult the comprehensive Forensic Watermarking documentation.