Domains
Custom domains are served through Cloudflare via a CNAME record. Apex domains are not supported — use a subdomain such as www.example.com.
List domains
Section titled “List domains”GET /api/v1/projects/{id}/domainsReturns { domains } — each { id, name, project_id, is_verified, a_records, cname_records, status }.
await client.domains.list(projectId)Add a domain
Section titled “Add a domain”POST /api/v1/projects/{id}/domainsBody: name. Returns { domain } with 201. Point a CNAME record at the returned cname_records target, then verify.
curl -X POST "https://www.frontend.co/api/v1/projects/$ID/domains" \ -H "Authorization: Bearer $FRONTEND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "www.example.com" }'const domain = await client.domains.create(projectId, 'www.example.com')console.log(domain.cname_records)Verify a domain
Section titled “Verify a domain”POST /api/v1/projects/{id}/domains/{domainId}/verifyRe-checks DNS and SSL status. Returns { domain, is_verified }.
await client.domains.verify(projectId, domain.id)Delete a domain
Section titled “Delete a domain”DELETE /api/v1/projects/{id}/domains/{domainId}Returns { deleted }.
await client.domains.delete(projectId, domain.id)