{"id":20159556,"url":"https://github.com/transloadit/heroku-addon","last_synced_at":"2026-03-05T16:09:10.139Z","repository":{"id":11463072,"uuid":"13927426","full_name":"transloadit/heroku-addon","owner":"transloadit","description":"The docs for Transloadit's Heroku Addon","archived":false,"fork":false,"pushed_at":"2023-05-23T13:37:43.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-13T13:48:51.328Z","etag":null,"topics":["encoding","heroku","transloadit","uploading"],"latest_commit_sha":null,"homepage":"https://devcenter.heroku.com/articles/transloadit","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transloadit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-28T14:03:00.000Z","updated_at":"2022-01-20T13:54:38.000Z","dependencies_parsed_at":"2025-01-13T13:45:36.560Z","dependency_job_id":null,"html_url":"https://github.com/transloadit/heroku-addon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fheroku-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fheroku-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fheroku-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fheroku-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transloadit","download_url":"https://codeload.github.com/transloadit/heroku-addon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241597451,"owners_count":19988253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","heroku","transloadit","uploading"],"created_at":"2024-11-14T00:08:57.838Z","updated_at":"2026-03-05T16:09:09.510Z","avatar_url":"https://github.com/transloadit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## heroku-addon\n\n[https://addons.heroku.com/transloadit](https://addons.heroku.com/transloadit)\n\nAn **Heroku addon** for [Transloadit](https://transloadit.com)'s file uploading and encoding service\n\n## Intro\n\n[Transloadit](https://transloadit.com) is a service that helps you handle file uploads, resize, crop and watermark your images, make GIFs, transcode your videos, extract thumbnails, generate audio waveforms, and so much more. In short, [Transloadit](https://transloadit.com) is the Swiss Army Knife for your files.\n\n[This](https://addons.heroku.com/transloadit) is an Heroku [add-on](https://addons.heroku.com) to make it easy to talk to the [Transloadit](https://transloadit.com) REST API.\n\n![Transloadit Uploads](https://s3.amazonaws.com/heroku.devcenter/heroku_assets/images/235-original.jpg 'Upload any file with Transloadit')\n\nDealing with hundreds of different media formats and running a scalable architecture\nthat can encode even the biggest files swiftly is no joke. Transloadit has spent\nthe last 4 years perfecting this and abstracting all this complexity into one\nbeatifully flexible and easy to use API.\n\n## Install\n\n\u003cp class=\"alert alert-warning\"\u003e\n  \u003cstrong\u003eWarning!\u003c/strong\u003e Heroku does not support overage in their billing and so we had to disable that on our end to be compatible with the platform without going bankrupt. This could result in stopping the service for you if you don't upgrade in time! If you'd rather enable overage, consider signing up for Transloadit directly.\n\u003c/p\u003e\n\nTransloadit can be attached to a Heroku application via the CLI:\n\n```bash\n$ heroku addons:add transloadit\n-----\u003e Adding transloadit to sharp-mountain-4005... done, v18 (free)\n```\n\n\u003cdiv class=\"callout\"\u003e\nA list of all plans available can be found \u003ca href=\"https://addons.heroku.com/transloadit\"\u003ehere\u003c/a\u003e.\n\u003c/div\u003e\n\nOnce Transloadit has been added the `TRANSLOADIT_AUTH_KEY` and `TRANSLOADIT_SECRET_KEY` settings will be available in the app configuration and will contain the credentials needed to authenticate to the [Transloadit API](https://transloadit.com/docs/api/). This can be confirmed using the `heroku config:get` command.\n\n```bash\n$ heroku config:get TRANSLOADIT_AUTH_KEY\n4bba21cf6d744fd1aeef0f0b72ec3212\n```\n\n## Usage\n\nWith your `TRANSLOADIT_AUTH_KEY` and `TRANSLOADIT_SECRET_KEY` in place you can now integrate it with any of our SDKs corresponding to\nyour project. Here's a list of our SDKs:\n\n- [Go SDK](https://github.com/transloadit/go-sdk)\n- [Java SDK](https://github.com/transloadit/java-sdk)\n- [Node.js SDK](https://github.com/transloadit/node-sdk)\n- [PHP SDK](https://github.com/transloadit/php-sdk)\n- [Rails SDK](https://github.com/transloadit/rails-sdk)\n- [Ruby SDK](https://github.com/transloadit/ruby-sdk)\n\n### Using with Ruby (Uses our Ruby SDK)\n\nVerify that the `TRANSLOADIT_AUTH_KEY` and `TRANSLOADIT_SECRET_KEY` variables are set.\n\nRuby applications need to add the following entry into their `Gemfile` specifying the Transloadit client library.\n\n```ruby\ngem 'transloadit'\n```\n\nThen update application dependencies with bundler.\n\n```bash\n$ bundle install\n```\n\nFinally re-deploy your application.\n\n```bash\n$ git add .\n$ git commit -a -m \"add transloadit instrumentation\"\n$ git push heroku main\n```\n\n### First encoding job\n\nAfter installing the `transloadit` Gem and deploying your app you can start talking to\nthe [Transloadit API](https://transloadit.com/docs/api/):\n\n```ruby\nrequire 'transloadit'\n\nputs \"Resizing lolcat.jpg on #{ENV['TRANSLOADIT_URL']}\"\n\ntransloadit = Transloadit.new(\n  :service =\u003e ENV['TRANSLOADIT_URL'],\n  :key     =\u003e ENV['TRANSLOADIT_AUTH_KEY'],\n  :secret  =\u003e ENV['TRANSLOADIT_SECRET_KEY']\n)\n\nresize = transloadit.step 'resize', '/image/resize',\n  :width  =\u003e 320,\n  :height =\u003e 240\n\nassembly = transloadit.assembly(\n  :steps =\u003e [ resize ]\n)\n\nresponse = assembly.submit! open('lolcat.jpg')\n\n# loop until processing is finished\nuntil response.finished?\n  sleep 1; response.reload! # you'll want to implement a timeout in your production app\nend\n\nif response.error?\n # handle error\nelse\n # handle other cases\nend\n```\n\n### Using with Ruby on Rails (Uses our Rails SDK)\n\nHere we'll show how to use Transloadit in a freshly\nsetup Rails project and Heroku app.\n\nIf you haven't already done so, go ahead and install Rails.\n\n```bash\n$ gem install rdoc rails\n```\n\nWith Rails installed, let's create a new app called 'transloku'.\n\n```bash\n$ rails new transloku\n$ cd transloku\n```\n\nIn order to use Transloadit in this app, we need to add the Gem to our Gemfile\nand bundle things up.\n\nRemove `sqlite3` from your Gemfile\n\n```bash\n$ echo \"ruby '2.0.0'\" \u003e\u003e Gemfile\n$ echo \"gem 'transloadit-rails'\" \u003e\u003e Gemfile\n$ echo \"gem 'pg'\" \u003e\u003e Gemfile\n$ bundle install\n```\n\nWith that in place, it's time to generate our Transloadit configuration, as\nwell as a basic `UploadsController` and a dummy `Upload` model.\n\n```bash\n$ rails g transloadit:install\n$ rails g controller uploads new create\n$ rails g model upload\n$ rake  db:migrate\n```\n\nThe controller generator we just executed has probably put two GET routes into\nyour `config/routes.rb`. We don't want those, so let's go ahead and overwrite\nthem with this.\n\n```ruby\nTransloku::Application.routes.draw do\n  resources :uploads\nend\n```\n\nNext we need to configure our `config/transloadit.yml` file. For this tutorial,\njust put in your credentials, and define an image resize step as indicated\nbelow:\n\n```yaml\nauth:\n  key: \u003c%= ENV['TRANSLOADIT_AUTH_KEY'] %\u003e\n  secret: \u003c%= ENV['TRANSLOADIT_SECRET_KEY'] %\u003e\n\ntemplates:\n  image_resize:\n    steps:\n      resize:\n        robot: '/image/resize'\n        format: 'jpg'\n        width: 320\n        height: 200\n```\n\nNote that we encourage you to enable authentication in your Transloadit Account\nand put your secret into the `config/transloadit.yml` to have your requests\nsigned.\n\nMake your `config/database.yml` look like this:\n\n```yaml\ndevelopment:\n  adapter: postgresql\n  encoding: unicode\n  database: transloku_development\n  pool: 5\n  password:\n\ntest:\n  adapter: postgresql\n  encoding: unicode\n  database: transloku_test\n  pool: 5\n  password:\n\nproduction:\n  adapter: postgresql\n  encoding: unicode\n  database: transloku_production\n  pool: 5\n  password:\n```\n\nAlright, time to create our upload form. In order to do that, please open\n`app/views/uploads/new.html.erb`, and put the following code in:\n\n```html\n\u003c%= javascript_include_tag\n'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js' %\u003e\n\n\u003ch1\u003eUpload an image\u003c/h1\u003e\n\u003c%= form_for Upload.new, :html =\u003e { :id =\u003e 'upload' } do |form| %\u003e \u003c%=\ntransloadit :image_resize %\u003e \u003c%= form.label :file, 'File to upload' %\u003e \u003c%=\nform.file_field :file %\u003e \u003c%= form.submit %\u003e \u003c% end %\u003e \u003c%= transloadit_jquerify\n:upload, :wait =\u003e true %\u003e\n```\n\nWith this in place, we can modify the `app/views/uploads/create.html.erb` view\nto render the uploaded and resized image:\n\n```html\n\u003ch1\u003eResized upload image\u003c/h1\u003e\n\u003c%= image_tag params[:transloadit][:results][:resize].first[:url] %\u003e\n```\n\nIn order to use the `transloadit` params in your controller and views you\nhave to include the `ParamsDecoder` into your controller. Let's do that for our\n`UploadsController`.\n\nOpen up `app/controllers/uploads_controller.rb` and adapt it like that:\n\n```ruby\nclass UploadsController \u003c ApplicationController\n  include Transloadit::Rails::ParamsDecoder\n\n  def new\n  end\n\n  def create\n  end\nend\n```\n\nThat's it. If you've followed the steps closely, you should now be able to\ntry your first upload. Don't forget to start your rails server first:\n\n```bash\n$ rails server\n```\n\nThen go to http://localhost:3000/uploads/new, and upload an image. If you did\neverything right, you should see the uploaded and resized file as soon as the\nupload finishes.\n\nAll looking sharp? Let's publish this to Heroku\n\n```bash\n$ git init\n$ git add .\n$ git commit -m \"init\"\n$ heroku login\n$ heroku create\n$ heroku addons:add transloadit\n$ heroku config:get TRANSLOADIT_AUTH_KEY\n$ git push heroku main\n$ heroku run rake db:migrate\n$ heroku open \u0026\u0026 heroku logs --tail\n```\n\nPoint your browser to `/uploads/new`\n\n### Using with any Language\n\nInstead of talking server-to-server, your website visitors can directly upload\nto Transloadit's specialized upload servers, so in theory there's no need for\nserver-side languages.\n\nThe easiest way to accomplish this would be to to include our\n[jQuery SDK](https://transloadit.com/docs/sdks/jquery-sdk/) in your HTML.\n\nIt includes a Twitter Bootstrap compatible progress bar, and it saves you\ndevelopment time having to handle the file uploads yourself, and then pushing it\nto our API.\n\n```html\n\u003cscript\n  type=\"text/javascript\"\n  src=\"//assets.transloadit.com/js/jquery.transloadit2-v3-latest.js\"\n\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  // We call .transloadit() after the DOM is initialized:\n  $(function () {\n    $('#MyForm').transloadit()\n  })\n\u003c/script\u003e\n```\n\nAlternatively, check our [Uppy](https://transloadit.com/docs/sdks/uppy/), our next-gen file uploader for the web.\n\n## Migrating between plans\n\nAs long as the plan you are migrating to includes enough allocated measurements for your usage, you can migrate between plans at any time without any interruption to your encoding.\n\nUse the `heroku addons:upgrade` command to migrate to a new plan.\n\n```bash\n$ heroku addons:upgrade transloadit:enterprise\n-----\u003e Upgrading transloadit:enterprise to sharp-mountain-4005... done, v18 ($299/mo)\n       Your plan has been updated to: transloadit:enterprise\n```\n\n## Removing the add-on\n\nTransloadit can be removed via the CLI.\n\n\u003cdiv class=\"warning\"\u003eThis will destroy all associated data and cannot be undone!\u003c/div\u003e\n\n```bash\n$ heroku addons:remove transloadit\n-----\u003e Removing transloadit from sharp-mountain-4005... done, v20 (free)\n```\n\n## Support\n\nAll Transloadit support and runtime issues should be submitted via one of the [Heroku Support channels](support-channels). Any non-support related issues or product feedback for Transloadit is welcome via [email](mailto:support@transloadit.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fheroku-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransloadit%2Fheroku-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fheroku-addon/lists"}