We need to have the ability to pass a signature param that will be added to the url.
We currently created a wrapper in our project to support this functionality since there are cases that client need to sign the image and send us back a signture which we need to add in the sdk url.
Thats our current implementation:
`
client.url = wrap(client.url, (func, publicId, transformation, ...args) => {
let modTransformation = transformation;
let modSignature;
We need to have the ability to pass a signature param that will be added to the url.
We currently created a wrapper in our project to support this functionality since there are cases that client need to sign the image and send us back a signture which we need to add in the sdk url.
Thats our current implementation:
` client.url = wrap(client.url, (func, publicId, transformation, ...args) => { let modTransformation = transformation; let modSignature;
if (transformation && transformation.signature) { const { signature, ...restTransformation } = transformation; modSignature = signature; modTransformation = restTransformation; }
const url = func.call(client, publicId, modTransformation, ...args);
if (!modSignature) return url;
const rawTransformation = client.transformation_string(modTransformation); const pos = url.indexOf(rawTransformation); return [url.slice(0, pos),
${modSignature}/
, url.slice(pos)].join(''); }); `