CDN Embedder with CDNetworks Edge Application
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
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
Section titled “Configuration”Source Configuration (config.js)
Section titled “Source Configuration (config.js)”Begin by updating your config.js file with the appropriate settings for your deployment:
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
Section titled “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 |
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
Section titled “Deployment”Prerequisites
Section titled “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
Section titled “Step 1: Build the Function”Edge Application takes the function as a single index.js file. Build it in the sample directory:
npm installnpm run bundleThis command writes the bundled function to dist/index.js. The same bundle is also attached to each GitHub release 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
Section titled “Step 2: Create the Function”- In Edge Application > Function List, create a function without a template.
- In CloudIDE, replace
index.jswith the bundledindex.js. - Click save and test to commit the code.
Step 3: Deploy and Add a Trigger
Section titled “Step 3: Deploy and Add a Trigger”- Deploy the function from Grayscale Deployment, and check that the version in the deployment record has changed.
- 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
Section titled “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
Section titled “Additional Resources”- CDNetworks Edge Application Documentation
- Add Triggers
- Doverunner Forensic Watermarking Embedding Documentation
Support
Section titled “Support”For additional assistance with CDN Embedder configuration or deployment, please contact Doverunner support or consult the comprehensive Forensic Watermarking documentation.