> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Domains

Manage custom domains.

## Custom Domains

The
[custom domains page](https://console.bijection.com/deployment/settings/custom-domains)
lets team admins serve the installation's API, its routes or one of its apps
from a [domain you own](https://docs.bijection.com/operate/networking/domains.md).

You can configure a custom domain, like `api.example.com`, to serve the API or
the [route reactions](https://docs.bijection.com/functions/reactions.md#routes) of a Bijection installation. The settings for this feature are on
the Installation Settings page of the installation. Adding a domain requires a team
administrator, and an installation can have up to 5 custom domains. The domain must
be one you control and can belong to only one installation at a time.

After you enter a domain, the settings page shows two DNS records to set with
your DNS provider:

* a CNAME from your domain to the installation's own host, which routes traffic,
  and
* a CNAME that validates the domain for its TLS certificate. Keep this record
  in place: it is also needed to renew the certificate.

Bijection checks the domain in the background. Once the certificate is issued
and attached, you will see a green checkmark:

![Custom Domains settings with a verified domain routed to the Bijection API](https://mintcdn.com/bijection-95ba84d3/MXGsXPKmgvoqOVRN/screenshots/components_custom_domains.png?fit=max\&auto=format\&n=MXGsXPKmgvoqOVRN\&q=85\&s=bf481bcd0f0e04e9bc60990a681faf97)

When you see that checkmark, your installation also serves traffic from that
domain.

Reach out to [contact@bijection.com](mailto:contact@bijection.com) if you have any
questions about getting set up.

## Domains for frontend apps

A deployed app can serve a personalized platform address such as
`analytics.bijection.app`, a subdomain such as `app.example.com`, or an apex such
as `example.co.uk`. Add it from Installation Settings, choosing the app as the
request destination, or use the CLI:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection app domain add web app.example.com --installation my-app:prod
bijection app domain inspect web app.example.com --installation my-app:prod
bijection app domain wait web app.example.com --installation my-app:prod --timeout 20m
bijection app domain list web --installation my-app:prod
```

The app must already have been deployed. Platform addresses share the
installation's wildcard DNS and HTTPS configuration, so they require no customer
DNS changes. A platform label remains reserved to its original app even after
its alias is removed.

For your own domain, copy the exact records returned by `add` or `inspect`:

* A TXT record at `_bijection.<hostname>` proves ownership of this registration.
  Its value includes a unique registration ID and challenge. A TXT value from a
  deleted registration cannot verify a new one. Complete this step within 24
  hours; otherwise remove the expired registration and add it again.
* A CNAME points a subdomain to the returned routing target. For an apex, use
  the provider's ALIAS, ANAME, or flattened CNAME with that same target. A plain
  CNAME at the zone apex is usually unavailable. Providers without flattening
  support can use a `www` subdomain instead.

Keep these records DNS only if your provider also offers a proxy. Bijection
creates the domain's managed certificate after ownership verification. The
status becomes `ready` after HTTPS, authentication configuration, edge routing,
and a public challenge response have all succeeded. `wait` observes this work;
its timeout does not cancel the accepted registration. Unverified requests in
other installations do not reserve your domain.

### Moving an existing website

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection app domain add web www.example.com --installation my-app:prod \
  --setup-mode existing_website
```

Keep the current site's routing during validation. Add the TXT proof, then
inspect the domain for `validation_redirect_from` and `validation_redirect_to`.
Configure that exact redirect on the current site so the certificate authority
can validate HTTPS before moving traffic. Once the certificate is issued, move
the routing record to the returned target and wait for `ready`. The dashboard's
**Website setup** selector exposes the same flow.

### Primary address and removal

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection app domain primary web www.example.com --installation my-app:prod
# Inspect the desired revision and the revision observed at the edge:
bijection app domain primary web --installation my-app:prod
# Reset to the app's generated address before removing its current primary:
bijection app domain primary web acme-web.bijection.app --installation my-app:prod \
  --secondary-behavior serve
bijection app domain remove web www.example.com --installation my-app:prod
```

Primary selection requires a ready domain of the same app. With
`redirect_documents`, other customer aliases send a temporary 307 redirect for
GET/HEAD document navigation, preserving the path and query. Authentication
callbacks, health checks, API calls, framework data and immutable publication assets
keep their origin. The generated app address remains available. With `serve`,
each alias serves directly. The dashboard offers **Make primary** and
**Use generated address** controls.

Managed apps use their current browser origin for AuthKit callbacks. Bijection
registers the verified origin and `/callback` URI in the installation's customer
WorkOS environment, retaining the original credential scope for retries and
removal. Apps with no AuthKit client configure no provider entries.

Removal withdraws routing first and retains the hostname until provider cleanup
is confirmed. This integration verifies WorkOS cleanup but does not remove CORS entries with
its environment credentials. The WorkOS dashboard or CLI can manage those entries. If this app
uses AuthKit, remove the old CORS origin and redirect URI in the original WorkOS
environment when the domain reports `AuthenticationRemovalRequired`. Bijection
checks their absence with the retained original credentials before freeing the
hostname. A rotated key cannot silently redirect cleanup to another environment.
Sessions and cookies belong to each origin; changing the primary address can
require signing in again.

## Certificates

Certificates are managed by Bijection only. Bijection requests, validates and
renews the TLS certificate for every custom domain, both API and routes
domains and app domains, using the DNS records described above. You cannot
upload your own certificate and private key, and Bijection does not produce a
certificate signing request (CSR) for you to sign with another certificate
authority, including a private one. A domain that must present a certificate
from your own certificate authority cannot be served through Bijection.

## Changing your default domain

On the same settings page, under *Override Environment Variables*, you can
change the default domains used for your installation.

To use a custom domain to serve your Bijection functions, there's an additional
step: override the `BIJECTION_CLOUD_URL` environment variable.

![Override Environment Variables, setting BIJECTION\_CLOUD\_URL to a custom domain](https://mintcdn.com/bijection-95ba84d3/MXGsXPKmgvoqOVRN/screenshots/components_override_environment_variables.png?fit=max\&auto=format\&n=MXGsXPKmgvoqOVRN\&q=85\&s=b64466b1860fc0327aa88013db1adb16)

`process.env.BIJECTION_CLOUD_URL` controls the default domain used for **the Bijection
API**. This will have an influence on:

* the URL used by your front-end to call your Bijection functions, when you
  [deploy your front end](https://docs.bijection.com/operate/installations/frontend) using
  `bijection deploy --cmd '...'`. Note that if you change the default Bijection
  API domain, you will need to deploy your website again for the changes to take
  effect.
* the value of `process.env.BIJECTION_CLOUD_URL` in Bijection functions.
* the OpenAPI spec generated with `bijection installation function spec --installation my-app:prod`

`process.env.BIJECTION_SITE_URL` controls the default domain used for
**routes**, where route reactions are served. This will have an influence on:

* the value of `process.env.BIJECTION_SITE_URL` in Bijection functions.
* when using Bijection Auth: the redirection URLs, and the `issuer` used for
  Bijection Auth tokens.
* any URL your functions build from it, such as the `resource` of an
  [MCP endpoint](https://docs.bijection.com/mcp).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.