> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/api-and-platform/domains/serve-didomi-assets-from-your-domain.md).

# Serve Didomi assets from your domain (web)

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 the Didomi web SDK.

* [Configure custom domain](#configure-custom-domain)
* [Configure the web SDK](#configure-the-web-sdk)

***

### Configure custom domain

Didomi offers two options when configuring the [custom domain](/api-and-platform/domains.md) that will be used to serve Didomi assets.

<table><thead><tr><th width="216">Option</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/ubsuzBbyyEUzFR1oVMHu">Domain delegation</a></td><td>The SDK will load Didomi assets via your domain but all the infrastructure will be handled by Didomi.</td></tr><tr><td><a href="/pages/NTUTjqEhagEDcAbO4QfC">Self-hosting via reverse proxy</a></td><td>The SDK will load assets from your domain and infrastructure.<br>This ensures that requests are processed and cached on your own servers while allowing you to use the latest version of the<br>SDK and its consent notice configuration.</td></tr></tbody></table>

### Configure the web SDK

Once your organization's custom domain is configured, the Didomi web SDK needs to be configured to used this domain for three types of requests:

* `loader.js` request from embed code
* Chunks loaded by the web SDK
* Requests sent to the API by the web SDK

In the sections below, we will cover how to update the embed code and web SDK to utilize your organization's custom domain.

#### Update embed code

Didomi products are implemented on your website via an embed code that was first retrieved from the Didomi console. This embed code needs to be updated by replacing `https://sdk.privacy-center.org` with your custom domain.

This ensures that the first request to load the Didomi SDK (the `loader.js` file) uses your custom domain.

#### Update SDK configuration

For other JavaScript files loaded by the Didomi web SDK, your organization must configure which paths to use by setting values for `sdkPath` and `apiPath` in the `window.didomiConfig` object.

For security reasons and to avoid injecting JavaScript on your website from the Didomi console, the `sdkPath` and `apiPath` properties cannot be set via Custom JSON in the Didomi console.\
They must be set directly on your website via the `window.didomiConfig` object.

{% hint style="info" %}
The `sdkPath` property must start with `http://`, `https://`, or `//`. It must also end with a final `/`. The `apiPath` property must start with `http://`, `https://`, or `//`.
{% endhint %}

```javascript
<script type="text/javascript">
window.didomiConfig = {
    sdkPath: 'https://dsdk.client.com/',
    apiPath: 'https://dsdk.client.com/api',
};
</script>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.didomi.io/api-and-platform/domains/serve-didomi-assets-from-your-domain.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
