Cloudflare Worker module 2.0.0

Breaking changes

Module import syntax

  • Use ES module syntax instead of Service Worker syntax

Worker configuration settings

Renamed:

  • DATADOME_IP_FILTERINGDATADOME_IP_EXCLUSION
  • DATADOME_URL_REGEXDATADOME_URL_REGEX_INCLUSION
  • DATADOME_JS_URL_REGEXDATADOME_JS_URL_REGEX_INCLUSION
  • DATADOME_LOG_VALUESDATADOME_LOGPUSH_CONFIGURATION

Removed:

  • DATADOME_URI_REGEX
  • DATADOME_URI_REGEX_EXCLUSION
  • DATADOME_HOSTNAME_REGEX_EXCLUSION
  • DATADOME_JS_URI_REGEX_EXCLUSION
  • DATADOME_JS_HOSTNAME_REGEX_EXCLUSION

DataDomeOptions interface

Renamed properties:

  • timeOuttimeout?: number
  • licenseKeyserverSideKey?: string

New properties:

  • ipExclusion?: string[] - List of IPv4 and IPv6 addresses to exclude from DataDome protection; accepts ranges with CIDR notation
  • urlPatternExclusion?: RegExp | string - Regex pattern to exclude URLs from DataDome protection
  • urlPatternInclusion?: RegExp | string - Regex pattern to include URLs for DataDome protection; all URLs will match if empty
  • enableDebugging?: boolean - Enable debugging mode
  • enableGraphQLSupport?: boolean - Enable GraphQL support
  • enableReferrerRestoration?: boolean - Enable referrer restoration
  • maximumBodySize?: number - Maximum body size in bytes (default: 25KB)
  • logpushConfiguration?: string[] - List of enriched headers names to log inside Logpush
  • clientSideKey?: string - Client-side key for JS Tag injection
  • jsURL?: string - URL of the JS Tag (default: https://js.datadome.co/tags.js)
  • jsEndpoint?: string - URL for the JS data endpoint
  • jsTagOptions?: Record<string, any> - Options for the JS Tag in JavaScript object format
  • jsURLRegexExclusion?: RegExp | string - Regex pattern to exclude URLs where JS Tag injection must not execute
  • jsURLRegexInclusion?: RegExp | string - Regex pattern to include URLs where JS Tag injection must execute; all URLs will match if empty

Logging system

  • Use Cloudflare Workers' native logging system for debugging information instead of adding debug headers to requests

Enhancements

  • Add CookiesList to payloads sent to Protection API
  • Improve error logging and debugging capabilities:
    • Include more details in error messages
    • Change log format to be easier to parse and analyze
  • Publish module as an npm package to ease installation