Migrate via Cloudflare Dashboard

Step 1: Extract your current configuration

  1. Connect to your Cloudflare Dashboard and go to the Workers & Pages section.
Cloudflare console tab.

Cloudflare Dashboard.

  1. In the Overview page, click on your current DataDome Worker, in this example datadome-worker.
Overview of Workers.

Overview of Workers.

  1. Click on the Edit code icon at the top of the page.
Quick edit Worker.

Quick edit Worker.

Step 2: Map the v1 configuration to your v2 configuration

  1. Retrieve the specific values that you may have set to configure your DataDome Worker that are not the default value to reuse them in the Worker v2 integration.
Name in Worker v1Default valueName in Worker v2
DATADOME_LICENSE_KEY'YOUR_DATADOME_SERVER_KEY'DATADOME_SERVER_SIDE_KEY
DATADOME_JS_KEY''DATADOME_CLIENT_SIDE_KEY
DATADOME_JS_URL'https://js.datadome.co/tags.js'DATADOME_JS_URL
DATADOME_JS_ENDPOINT''DATADOME_JS_ENDPOINT
DATADOME_JS_TAG_OPTIONS'{ "ajaxListenerPath": true }’DATADOME_JS_TAG_OPTIONS
DATADOME_TIMEOUT300DATADOME_TIMEOUT
DATADOME_LOG_VALUES[]DATADOME_LOGPUSH_CONFIGURATION
DATADOME_URI_REGEXnullFused with DATADOME_URL_REGEX_INCLUSION
DATADOME_URL_REGEXnullDATADOME_URL_REGEX_INCLUSION
DATADOME_URI_REGEX_EXCLUSIONSee list of static assets below.DATADOME_URI_REGEX_EXCLUSION
DATADOME_HOSTNAME_REGEX_EXCLUSIONnullIs now set inside Worker's Triggers -> Custom Domains
DATADOME_JS_HOSTNAME_REGEX_EXCLUSIONnullFused with DATADOME_JS_URL_REGEX_EXCLUSION
DATADOME_JS_URI_REGEX_EXCLUSIONnullFused with DATADOME_JS_URL_REGEX_INCLUSION
DATADOME_URL_REGEX_EXCLUSIONnullDATADOME_JS_URL_REGEX_EXCLUSION
DATADOME_JS_URL_REGEXnullDATADOME_JS_URL_REGEX_INCLUSION
DATADOME_IP_FILTERINGnullDATADOME_IP_EXCLUSION
DATADOME_ENABLE_DEBUGGINGfalseDATADOME_ENABLE_DEBUGGING
DATADOME_ENABLE_GRAPHQL_SUPPORTfalseDATADOME_ENABLE_GRAPHQL_SUPPORT
/\.(avi|flv|mka|mkv|mov|mp4|mpeg|mpg|mp3|flac|ogg|ogm|opus|wav|webm|webp|bmp|gif|ico|jpeg|jpg|png|svg|svgz|swf|eot|otf|ttf|woff|woff2|css|less|js|map)$/i

Step 3: Migrate to new version

  1. In the Settings tab, inside the Variables and Secrets panel, click on Add .
  1. Select the type Secret.
  2. Enter the variable name DATADOME_SERVER_SIDE_KEY and set the value that is available in your DataDome dashboard.
  3. Click on Deploy.
  4. Click on Add again.
  5. Select the type Secret.
  6. Enter the variable name DATADOME_CLIENT_SIDE_KEY and set the value that is available in your DataDome dashboard.
  7. Click on Deploy.
  8. Click on the Edit code icon at the top of the page.
  1. Download the latest version of our Cloudflare Worker script.
  2. Delete the existing code and paste the code from dist/datadome.js in the Script Editor.
  3. Update the settings in the code using the table created in step 2.
  4. Click on Deploy.
  1. Congrats! You migrated from DataDome Worker v1 to DataDome Worker v2!