Custom domains
A project can serve its API from a domain you verify, and a sign-in app can serve the hosted sign-in page from one. Both are optional, and each has a Fóir default until you set it up.
An API domain for a project
Register a hostname in the console under Settings, then API domains. Once it is verified, the project's API answers there as it does on the default api.foir.dev. Your domain serves GraphQL queries and subscriptions, the schema endpoint used for code generation and the file upload endpoints. Caching, rate limits and errors are the same on both hostnames.
A login domain for a sign-in app
A login domain belongs to one sign-in app. You list it in config or add it in the console, and the hosted sign-in page is served there. The default is auth.foir.io. When the login domain shares a registrable domain with your app, Fóir's session cookie is first-party to it, which the cookie-session flows for single-page and server-rendered apps require.
Verifying a hostname
Registering shows two DNS records: a CNAME that points your hostname at Fóir's edge, and a TXT record that carries a verification token. Once the TXT record is found, the domain is verified. TLS is issued automatically on the first request to a newly verified domain, which can take a moment, and is renewed for you.
Registering does not reserve a hostname. Several projects can hold a pending claim, the first to publish its TXT record becomes the single verified owner, and pending claims are cleared after seven days.
What a custom domain does not change
An API domain is routing only. Every request still needs the project's key, and a request whose domain belongs to a different project from its key is refused. File and media URLs do not move to your domain. The number of custom domains depends on your plan.
Read the detail
The custom API domains page covers what is served on your domain, the DNS records, hostname ownership and troubleshooting.