# Serve Didomi assets from your domain

By default, whether used to load a consent notice, a preference center, or a privacy request widget, the Didomi Web SDK, including its assets (JavaScript files, images, etc.) and API requests, relies on the **privacy-center.org** domain.

This guide will walk you through how to configure the Web SDK to use your own domain instead.

## Setup a custom domain

Configure your domain to serve Didomi assets by following our [Custom domain guide](https://developers.didomi.io/cmp/web-sdk/custom-domain).

We offer two options for custom domains:

* [Domain delegation](https://developers.didomi.io/api-and-platform/domains/domain-delegation): Browsers will load Didomi assets via your domain but all the infrastructure will be handled by Didomi.
* [Self-hosting via reverse proxy](https://developers.didomi.io/api-and-platform/domains/reverse-proxy/self-hosting): Browsers will load Didomi assets from your domain and infrastructure. This ensures that the SDK and API 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 SDK

Once your custom domain is setup, the SDK needs to be configured to use your domain for three types of requests:

* The initial `loader.js` request that is sent directly from the Embed code obtained from the Didomi Console.
* The chunks loaded by the SDK itself.
* Requests sent to the API by the SDK.

The following steps explain how to configure the SDK.

### Step 1 - Update the Embed code

Update the Embed code from the Didomi Console to replace [`https://sdk.privacy-center.org/`](https://sdk.privacy-center.org/) with your sub-domain. This ensures that the first request to load the Didomi SDK (the `loader.js` file) uses your sub-domain.

### Step 2 - Update the SDK configuration

For the other JavaScript files loaded by the SDK, you must configure the paths to use by setting the `sdkPath` and `apiPath` properties in the `window.didomiConfig` object:

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

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 `//`.

{% hint style="danger" %}
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.
{% endhint %}
