Back to Examples

Transloadit

Transloadit is a powerful API for file uploading and media processing, enabling developers to build custom workflows with ease.

Lines
213
Sections
7

Want your own llms.txt file?

Generate a professional, AI-friendly file for your website in minutes!

llms.txt Preview

# Transloadit

> Transloadit is a versatile file uploading and processing API that allows developers to create complex media processing workflows through declarative JSON recipes called Assembly Instructions.

## Uploading and importing (INPUT)

Transloadit handles file uploads over XHR or tus.io (our open source protocol for resumable file uploads) and can process files through various "Robots" (specialized processing steps) that can be chained together to create customized workflows.

## Encoding workflows (PROCESS)

Assembly Instructions at a glance:

```json
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "browser720_webm_encoded": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "webm",
      "width": 1280,
      "height": 720
    },
    "browser720_h264_encoded": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "mp4",
      "width": 1280,
      "height": 720
    },
    "thumbed": {
      "use": "browser720_h264_encoded",
      "robot": "/video/thumbs",
      "width": 1280,
      "height": 720,
      "format": "jpg",
      "resize_strategy": "fit",
      "count": 1,
    },
    "exported": {
      "use": ["browser720_webm_encoded", "browser720_h264_encoded", "thumbed", ":original"],
      "robot": "/s3/store",
      "credentials": "demo_s3_credentials",
      "url_prefix": "https://demos.transloadit.com/"
    }
  }
}
```

As you can see, our features are called Robots, and each Step inside
the Assembly Instructions can refer one. Robots can pass files to each other
with the `use` keyword. This means you can create complex workflows
unique to your application.

## Exporting to cloud storage or downloading results (OUTPUT)

Transloadit can export to all the major cloud storage providers.
Customers first need to store their credentials in their Transloadit account and
then refer to them in the Assembly Instructions.

Alternatively, Transloadit keeping 24h of temporary storage, you can directly download
resulting files when an Assembly is finished.

All meta data is available on a unique Assembly URL which contains the Assembly Status JSON.

## Example integration code with Node.js

```js
// npm install transloadit
const { Transloadit } = require('transloadit')

const transloadit = new Transloadit({
  authKey: 'TRANSLOADIT_KEY',
  authSecret: 'TRANSLOADIT_SECRET',
})

const options = {
  files: {
    file1: '/PATH/TO/FILE.jpg',
  },
  params: {
    steps: {
      // You can have many Steps. In this case we will just resize any inputs (:original)
      ':original': {
        robot: '/upload/handle',
      },
      resize: {
        use: ':original',
        robot: '/image/resize',
        result: true,
        width: 75,
        height: 75,
      },
    },
    // OR if you already created a template, you can use it instead of "steps":
    // template_id: 'YOUR_TEMPLATE_ID',
  },
  waitForCompletion: true, // Wait for the Assembly (job) to finish executing before returning
Preview of Transloadit's llms.txt file. View complete file (213 lines) →

Ready to create yours?

Generate a professional llms.txt file for your website in minutes with our AI-powered tool.

Generate Your llms.txt File