Skip to content

Function: proxyUrl() ​

ts
function proxyUrl(
   endpoint, 
   sourceUrl, 
   operations?
): string;

Defined in: proxy/proxy-url.ts:16

Builds a proxified url: operations sit between the endpoint and the embedded source url, whose query string is preserved as-is. The source domain must be allow-listed in the project settings.

Parameters ​

ParameterTypeDefault value
endpointstringundefined
sourceUrlstringundefined
operations?readonly CdnOperation[][]

Returns ​

string

See ​

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

Example ​

ts
proxyUrl('https://pubkey.ucr.io', 'https://example.com/a.jpg', [preview()])
// → https://pubkey.ucr.io/-/preview/https://example.com/a.jpg