# Custom Domain (/docs/sdk/custom-domain)



For maximum delivery rates, set up a custom domain that CNAMEs to
`in.layers.com`. Ad-blockers commonly block known analytics domains;
your own `events.yourdomain.com` is rarely blocked.

## Setup [#setup]

1. Project → Layers → Layers SDK → **Custom domain** → click **Add**.
2. Choose your subdomain (e.g., `events.yourdomain.com`).
3. Layers shows the CNAME target (e.g., `cdn.layers-edge.com`).
4. In your DNS provider, add the CNAME record:
   ```
   events.yourdomain.com.  CNAME  cdn.layers-edge.com.
   ```
5. Click **Verify** in Layers. Cert provisioning happens within minutes.
6. Layers issues a Let's Encrypt cert via ACME challenge.

## Update SDK [#update-sdk]

Pass the new endpoint as `baseUrl` in the config:

```ts
// @layers/client (web / Node)
new LayersClient({
  apiKey: 'unused',
  appId: 'app_xxx',
  environment: 'production',
  baseUrl: 'https://events.yourdomain.com',
});

// @layers/react-native
await Layers.init({
  apiKey: 'unused',
  appId: 'app_xxx',
  environment: 'production',
  baseUrl: 'https://events.yourdomain.com',
});
```

## Verification [#verification]

* DNS propagation: 5 min – 24h.
* Cert provisioning: \<5 min after DNS verifies.
* Status visible in Project → Layers → Layers SDK → Custom domain panel.

## Multiple custom domains [#multiple-custom-domains]

You can set multiple per project (e.g., `events.app.com` for the app,
`events.web.com` for the website). Both CNAME to the same edge
endpoint.

## Removing [#removing]

Click **Remove** in the panel. After removal:

* DNS record can be deleted at your provider.
* Existing SDKs configured for that endpoint will fail until reconfigured.

## Cert renewal [#cert-renewal]

Automatic via ACME. No action needed.

## Privacy benefits [#privacy-benefits]

Beyond ad-blocker bypass, custom domains keep all event traffic visibly
"yours" — useful for privacy-sensitive audiences who scrutinize what
domains your app talks to.
