Integration within SFCC

This guide describes how to integrate DataDome SDK in your Android application within Salesforce Commerce Cloud (SFCC) environment.

Integration within SFCC is only supported through OkHttp Integration. Manual integration is not supported yet.

Prerequisites

Additional configuration for Challenge display

In SFCC, the Challenge display is handled through a redirection. Add the steps below to ensure this redirection works correctly.

  1. Enable bypassAcceptHeaderat the SDK initialization
    dataDomeSdk = DataDomeSDK
                    .with(application, BuildConfig.DATADOME_SDK_KEY, BuildConfig.VERSION_NAME)
                    .listener(dataDomeSDKListener) // optional 
                    .manualListener(dataDomeSDKManualIntegrationListener) // optional
                    .bypassAcceptHeader(true) // must set to true for SFCC
    
  2. Disable OkHttp client redirection
val builder = OkHttpClient.Builder()
                    .followRedirects(false)
                    .followSslRedirects(false)

CookieJar implementation

A CookieJar is essential for maintaining SFCC session integrity between your OkHttp client and DataDome SDK by passing the dwsidSFCC cookie, ensuring the correct display of challenges.

  1. Complete CookieJar interface implementation steps.
  2. Make sure to attach the CookieJarto your OkHttp client so that it can correctly persist the dwsid SFCC cookie from your API call response.