React Native SDK for Axios 4.0.0

  • Build the SDK on top of the CoreDataDome SDK (@datadome/react-native-core-datadome), which handles native code, cookie storage and challenge display
  • Add DataDomeInterceptor.attach(instance) and eject(instance), which protect every request of an Axios instance (the default axios export or a custom one)
  • Add the DataDome constructor, configured with a clientKey and an optional domain
  • Display challenges natively, with no component to add to the views
  • Drop the react-native-webview peer dependency: the app can uninstall it if it doesn't use it elsewhere
  • Retry the request automatically after a solved challenge, from the request's adapter: the app's interceptors and transforms run once per request, whatever the number of attempts
  • Stop retrying a request cancelled during a challenge (signal or cancelToken)
  • Protect requests whatever their Axios adapter (default, instance or per-request), including the fetch adapter with a custom env.fetch
  • Send the request and return the response unchanged when the CoreDataDome SDK fails
  • Export DataDome, ResponseValidationStatus, and the DataDomeConfiguration and DataDomeCookie types from the CoreDataDome SDK

Breaking changes

  • Rename the package from @datadome/datadome-axios to @datadome/react-native-datadome-axios
  • Add @datadome/react-native-core-datadome (1.0.0+) as a peer dependency, to install in the application
  • Require React Native 0.85+ with the New Architecture (previously 0.72+), iOS 15.1+ (previously 12+), Android minSdkVersion 24+ (previously 21+), and Axios 1.12+ (previously 1.11+)
  • Replace DataDome.getInstance().setSdkKey(), DataDome.configure() and DataDome.configureWithOrigin() with new DataDome({ clientKey })
  • Replace new DataDomeInterceptor({ axiosInstance }) and the manual interceptor setup with requestAdapter, responseEventHandler and responseAdapter by new DataDomeInterceptor(dataDome).attach(instance)
  • Replace getStoredDataDomeCookie() with dataDome.getCookie(url), and remove storeCookie()
  • Remove DataDomeModal
  • Remove enableVerboseLogs