Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Cloudinary Parse Module for easy integration
tree: 15a6517a1b

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Cloud code

This package contains Cloudinary's integration pack for Parse Cloud Code. The cloudinary library provides a mechanism for storing cloudinary credentials and signing upload requests.
Also provided in this package is sample code of a simple Cloud Function that signs upload requests for authenticated users.


  • cloud/main.js - The main cloud code file loaded by parse. Contains:
    • A sample cloud function (sign_upload_request) that returns an object with all required parameters to initiate a direct upload to cloudinary.
      The function requires an authenticated Parse user and embeds the username into the tags field.
      The returned data can be used to construct an HTML form or passed to cloudinary front-end libraries to initiate an image upload.
    • A sample beforeSave factory (beforeSaveFactory). When given an object_name and a field_name, creates a beforeSave function that verifies updates to field_name are only done with a signed cloudinary identifier.
      The beforeSave function also removes the signatures when saving to the database.
  • cloud/cloudinary/all.js - The cloudinary library entrypoint. In order to load cloudinary library you must require('cloud/cloudinary/all') the result of this expression is the cloudinary namespace. See cloud/main.js for sample usage.
  • cloud/cloudinary_config.js holds cloudinary configuration as demonstrated in cloud/cloudinary_config.js.sample

Setup the sample project

  • Signup or login to Parse
  • Create a new app
  • Install the Cloud Code Command Line Tool (See Cloud Code Guide for more info)
  • Create a new project with parse new
  • Copy the files in this package to the new project folder
  • Create cloudinary configuration file (cloudinary_config.js)
  • Deploy your code parse deploy

You're now ready to go


Supplying cloudinary configuration can be specified either by providing cloudinary_config.js in the cloud directory, or by directly calling cloudinary.config with a configuration object (See comment in main.js for sample usage).

Sample usage with cURL


curl -X POST \
  -H "X-Parse-Application-Id: PARSE_APP_ID" \
  -H "Content-Type: application/json" \
  -d '{"username":"MY_USER","password":"MY_PASS"}' \


curl -X GET \
  -H "X-Parse-Application-Id: PARSE_APP_ID" \
  -G \
  --data-urlencode 'username=MY_USER' \
  --data-urlencode 'password=MY_PASS' \



Get signature

Use sessionToken from login response

curl -X POST \
  -H "X-Parse-Application-Id: PARSE_APP_ID" \
  -H "X-Parse-Session-Token: SESSION-TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}' \


  "result": {

Upload image to Cloudinary using obtained signature

Using the response from sign_upload_request:

curl -X POST \
  -F timestamp=1366555048 \
  -F tags=MY_USER \
  -F api_key="CLOUDINARY_API_KEY" \
  -F file=@MY_IMAGE.jpg \




You can open an issue through GitHub.

Contact us at

Or via Twitter: @cloudinary


Released under the MIT license.

Something went wrong with that request. Please try again.