Flag of Ukraine

Dynamic Evaluation

If placeholder variables like ${file.meta.width} aren't enough to implement your application logic, you can also use the full feature set of modern JavaScript to create dynamic Assembly instructions. These scripts will be executed on our infrastructure, and have access to all Assembly Variables.

For example, you might want to resize images to adhere to the design principle of the Golden Ratio:

{
  "robot": "/image/resize",
  "height": "${file.meta.width / (1 + Math.sqrt(5))/2}",
  "resize_strategy": "crop"
}

Or you could want to transform the output file name to upper case when uploading to S3:

{
  "robot": "/s3/store",
  "path": "my-folder/${file.name.toUpperCase()}",
}

Everything inside ${...} will get evaluated, and you have all language features available, as long as your script doesn't perform any asynchronous operations.

Variable lookup

Dynamic evaluation is free of charges when it is a simple lookup, such as ${file.name} or ${file.meta.faces[0]}.

For more complex evaluations, such as ${Math.max(10, file.meta.width)}, there are charges. This is because we invoke our /script/run Robot to interpret JavaScript, making evaluations harder on our machines, and a few milliseconds slower, but with a full programming language at your disposal, also that much more powerful.

Uppy
20% off any plan for the Uppy community
Use the UPPY20 code when upgrading.
Sign up
tus
20% off any plan for the tus community
Use the TUS20 code when upgrading.
Sign up
Product Hunt
20% off any plan for Product Hunters
Use the PRH20 code when upgrading.
Sign up