Skip to content

Function: detectDomainKind() ​

ts
function detectDomainKind(url): DomainKind;

Defined in: domain.ts:17

Classifies a CDN host:

  • legacy — ucarecdn.com (and its environment subdomains)
  • prefixed — project-prefixed *.ucarecd.net
  • proxy — delivery proxy *.ucr.io
  • custom — anything else (user CNAME)

Parameters ​

ParameterType
urlstring

Returns ​

DomainKind

Throws ​

TypeError on unparseable input.

See ​

https://uploadcare.com/docs/delivery/cdn/

Example ​

ts
detectDomainKind('https://1zlmtnsbgr.ucarecd.net') // → 'prefixed'