# Custom Domain

By default, the Allegro SDK loads from the tenant subdomain:

```text
https://acme.allegrocdp.com/client.js

```

A custom domain lets you serve the SDK and its API endpoints from a domain you control instead:

```text
https://cdn.acme.com/client.js

```

This keeps SDK traffic on your own brand and origin, which is useful when you want the embed and its API requests to appear first-party to the browser.

Set by your Allegro administrator

A custom domain must be configured by an Allegro administrator, who maps the domain to your tenant and points DNS at the Allegro instance. You cannot set it from the SDK or the browser. Once it is in place, the steps below describe how the SDK uses it. For the setup and hosting details, see [Custom Domain (Platform)](/developer/platform/setup/custom-domain.md).

## How the SDK Uses It[​](#how-the-sdk-uses-it "Direct link to How the SDK Uses It")

The SDK determines its API base URL from the `src` attribute of the `<script>` tag that loads `client.js`. Load the script from your custom domain and every API call the SDK makes — authentication, event tracking, interactions, checkout — goes to that domain automatically. No extra SDK configuration is required:

```html
<!-- All SDK API requests go to cdn.acme.com -->
<script src="https://cdn.acme.com/client.js" data-tenant="acme"></script>

```

## CORS and Return URLs[​](#cors-and-return-urls "Direct link to CORS and Return URLs")

When a custom domain is configured, Allegro automatically includes it in the list of allowed [browser origins](/developer/administration/browser-settings.md) alongside the subdomain — you do not need to add it manually. That same list validates the return URLs used by [magic link](/developer/guides/authentication/magic-links.md) and [checkout](/developer/guides/payment/purchases.md) flows, so those redirects work on the custom domain out of the box.

## Related[​](#related "Direct link to Related")

* [Browser Settings](/developer/administration/browser-settings.md) — Allowed origins and cookie scope
* [Custom Domain (Platform)](/developer/platform/setup/custom-domain.md) — DNS, routing, and hosting configuration
* [Script Tag](/developer/guides/script-tag.md) — Embedding the SDK on your site
