| Member | Does |
|---|---|
| deploy(options) | Puts files, or code, online. |
| update({ label }) | Renames it — the label only. |
| deploys() | The history. |
| rollback(deployId) | Puts an earlier deploy back online. |
| usage() | What it uses. |
| remove() | Deletes it. |
| domains | attach · list · detach. |
const site = await api.hosts.get(id);
await site.deploy({ files: "./out" });
await site.domains.attach("www.example.com");site = api.hosts.get(host_id)
site.deploy(files="./out")
site.domains.attach("www.example.com")The slug cannot change
It is the address. Changing it would break shared links, the attached domain and the certificate — update() changes the label only, and another address means another host.
Deploying is not building
Build where the code is; send the result here. A deploy pointed at a source folder publishes sources, successfully — which is what makes it worth saying twice.