Custom domains
By default your account serves from its auto host <slug>.cdn.oblien.com. You
can serve from your own domain instead — cdn.yourbrand.com. A custom domain
is account-level: it serves all of your CDN files (across every namespace),
just like the auto host.
A custom domain is a delivery alias for your account host — it doesn't change where files live or how they're organized. Namespace stays an API-side tag on each file; the domain just changes the hostname in your URLs.
How it works
- Point DNS at the Oblien edge (CNAME to
edge.oblien.com, or an A record to the edge IP) and add the ownership TXT record. - Connect it with
POST /cdn/domains. Oblien verifies DNS, provisions a per-domain TLS certificate, and routes the host to your account's storage. The route registers immediately; SSL flips toactiveonce DNS resolves. - Mint permits with
cdnHostso returned URLs use the domain.
DNS records
| Type | Host | Value |
|---|---|---|
| CNAME (or A) | cdn.yourbrand.com | edge.oblien.com (or the edge IP) |
| TXT | _opsh.cdn.yourbrand.com | verify=<cdn-slug> |
The exact records (including the verify= value) are returned in
dns.required_records of the connect call if DNS isn't ready yet — point the
domain, then call connect again.
Connect a domain
const res = await oblien.cdn.domains.add({ domain: 'cdn.yourbrand.com' });
if (res.ssl.status === 'active') {
console.log('Live:', res.url); // https://cdn.yourbrand.com
} else {
console.log('Set these DNS records:', res.dns.required_records);
}POST /cdn/domains
X-Client-ID: <id>
X-Client-Secret: <secret>
Content-Type: application/json
{ "domain": "cdn.yourbrand.com" }curl -X POST https://api.oblien.com/cdn/domains \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"domain":"cdn.yourbrand.com"}'Response
{
"success": true,
"domain": "cdn.yourbrand.com",
"host": "cdn.yourbrand.com",
"url": "https://cdn.yourbrand.com",
"ssl": { "status": "pending", "expiresAt": null },
"dns": {
"verified": false,
"required_records": {
"cname": { "host": "cdn.yourbrand.com", "target": "edge.oblien.com" },
"txt": { "host": "_opsh.cdn.yourbrand.com", "value": "verify=<cdn-slug>" }
}
}
}ssl.status is pending until DNS resolves to the edge, then active (a
per-domain certificate is issued automatically and auto-renews).
List & remove
// List your account's CDN hosts (auto subdomain + custom domains)
const { domains } = await oblien.cdn.domains.list();
// domains[] → { domain, custom, status, createdAt }
// Remove a custom domain (the auto subdomain can't be removed)
await oblien.cdn.domains.remove('cdn.yourbrand.com');GET /cdn/domains
DELETE /cdn/domains/cdn.yourbrand.comcurl "https://api.oblien.com/cdn/domains" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" -H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"
curl -X DELETE "https://api.oblien.com/cdn/domains/cdn.yourbrand.com" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" -H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Use it for uploads
Once connected, mint permits with cdnHost so returned URLs use the domain:
const { token } = await oblien.cdn.token({
namespace: 'customer-123', // still just the API-side tag (quota/sort)
cdnHost: 'cdn.yourbrand.com', // delivery host for returned URLs
});
// → uploaded files return URLs like https://cdn.yourbrand.com/static/ab/cd/file.jpgNotes
- Account-level & delivery-only — a custom domain serves your whole account's
files; uploads still go through a permit.
cdnHostmust be a domain you've connected, else400 invalid_cdn_host(no host spoofing). - Serving is read-only static delivery over HTTPS with long-lived caching.
- Delivery traffic on a custom domain bills to your account — one meter per account, whether served from the auto host or a custom domain.
- Errors:
dns_not_configured(records not set yet — seedns.required_records),domain_unavailable(already in use),feature_locked(plan doesn't include custom domains),cannot_remove_subdomain(the auto host).