Serve Didomi assets from your domain (mobile)
By default, Didomi relies on the privacy-center.org domain when serving assets- whether that is to load a consent notice, a preference center, or a privacy request widget, Didomi's SDKs and integrations, including their assets (JavaScript files, images, etc.) and API requests.
In this article, we will cover how to configure your integration so that these assets are served from your organization's own domain instead when utilizing Didomi mobile SDKs.
Configure custom domain
Didomi offers two options when configuring the custom domain that will be used to serve Didomi assets.
The SDK will load Didomi assets via your domain but all the infrastructure will be handled by Didomi.
The SDK will load assets from your domain and infrastructure. This ensures that requests are processed and cached on your own servers while allowing you to use the latest version of the SDK and its consent notice configuration.
Configure the mobile SDK
Once your organization's custom domain is set up, pass sdkPath and apiPath to DidomiInitializeParameters when initializing the SDK:
sdkPath: overrides the base URL for all static file requests (consent notice config, GVL, IAB vendor list). Defaults to the Didomi CDN.apiPath: overrides the base URL for all API requests (Consents API, cross-device sync, API events). Defaults to the Didomi API.
let parameters = DidomiInitializeParameters(
apiKey: "your-api-key",
noticeID: "your-notice-id",
sdkPath: "https://sdk.example.com",
apiPath: "https://api.example.com"
)
Didomi.shared.initialize(parameters)val parameters = DidomiInitializeParameters(
apiKey = "your-api-key",
noticeId = "your-notice-id",
sdkPath = "https://sdk.example.com",
apiPath = "https://api.example.com"
)
Didomi.getInstance().initialize(application, parameters)Didomi.initialize({
apiKey: 'YOUR_API_KEY',
noticeId: 'YOUR_NOTICE_ID',
sdkPath: 'https://sdk.example.com',
apiPath: 'https://api.example.com',
});DidomiSdk.initialize(DidomiInitializeParameters(
apiKey: 'YOUR_API_KEY',
noticeId: 'YOUR_NOTICE_ID',
sdkPath: 'https://sdk.example.com',
apiPath: 'https://api.example.com',
));Last updated