Domains & hostnames
Domains and hostnames are used to route your delivery API requests to ensure the correct data is returned. This is especially important if you have a multiple-site setup.
Environment clients are always linked to exactly one environment and provide an API key to be used in the delivery API request.
Domains are site-specific and not Environment client specific. This means that an Environment client can have multiple domains as an Environment client can point to an environment with multiple sites. This could be the case if you, e.g. have a single CMS installation containing multiple sites.
Domains are site-specific and should only contain hostnames related to one specific site.
A domain can have multiple hostnames if the same site is available on multiple hostnames.
Don't use the same domain for hostnames associated with different sites, as domains are site specific.
Using the same domain for hostnames associated with different sites can result in data from the wrong site being returned from the delivery API if two source entities have the same relative path.
If you only have one site, you could skip the hostnames and use the relative URL's instead. This will, behind the scene, create a hostname with the value of
root.tld, making it possible to use relative URL's when requesting the delivery API.