To get started with a new app, you'll need to gather both your Application ID and your REST API Key from your dashboard settings area.

Using the Config

The plugin Config module allows you to store commonly needed values for making Parse requests. If the config values are set, they will automatically be used when needed.

At the bare minimum we must add the Parse app Application ID and REST API Key to the plugin Config (Not to be confused with parse.Config).

On the main page, or near the start of your app, you should set your Config values:

local parse = require 'plugin.parse'

--== These settings are mandatory for the plugin
--== Optional setting for external Parse-Server

Now the auth data is stored and can be used for requests.

Plugin Config Methods

The plugin config methods are both getters and setters. The only parameter options are true or false. You can also remove the method from the code altogether, essentially setting the config option to false.

-- Set debug enabled
parse.config:debugEnabled( true )
-- Get debug enables value
local debug_on = parse.config:debugEnabled()

Config Options

Option Details Required
:cloudAddress External Parse-Server endpoint Depends on hosting
:applicationId The Parse app id Yes
:restApiKey The Parse app REST api key Yes
:debugEnable Print incoming data to the terminal No
:debugVerbose Print all incoming data No
:installationId An install id Depends on method
:timeout Time to wait for a response No - default: 30

Debug Mode

The plugin config also handles enabling the debugging output, which can be very helpful while building out your app, as the data is output to the terminal automatically. You can turn on the debug flag to get a print out of data in your Config:


This mode will print out the response data, but nothing more. If you'd like to see all the response, and some request data, add verbose debugging:


If you need to disable debugging temporarily, you can pass false to either debug method, or just remove them.

Add Config Extras

You can add other values to the config that you can use throughout your app.

-- Set custom config value
parse.config:set("app_title", "MyApp")

-- Get custom config value
local appTitle = parse.config:get("app_title")

Parsing It Out

You'll spend most of your time learning how to use the plugin, and Parse, by reading the Parse REST API guide. It offers examples, useful notes, and advice for every piece of functionality in the API.

The Parse Plugin can handle every situation, but you will need to learn a bit about "translating" the curl examples on, because sadly, it's not displayed in Lua.

Some Tips for The Road Ahead

Here are some things to look out for in the curl examples:

  • A -d flag is short for 'data', this pairs with the :data() or :set() methods.
  • A -data-urlencode flag pairs with the :options() method.
  • A where={...} will usually pair with the :where() method.
  • Ignore any -H flags (header). These are handled by the plugin.
  • Ignore the url path, you'll use the request object constants.

Be sure to read the Parse to Lua chapter.


Logging in a User

  curl -X GET \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \
    -H "X-Parse-Revocable-Session: 1" \
    -G \
    --data-urlencode 'username=cooldude6' \
    --data-urlencode 'password=p_n7!-e8' \

In this login example from, we can see the structure of a "GET" method. You should notice the two --data--urlencode values. This gives us a clue that we should us the :options() method. Since this is the login method, we need to use the correct endpoint object. In this case that would be parse.User.login. Let's see what it would look like in the client code:

  parse.request( parse.User.login )
  :options( { username = "cooldude6", password = "p_n7!-e8" } )

Check Session / Current User

A User must be logged in for the following to work.

  curl -X GET \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \
    -H "X-Parse-Session-Token: r:pnktnjyb996sj4p156gjtp4im" \

This one is super simple. There isn't anything we need to convert, except the endpoint, which in this case would be We also check for a 209 code from Parse, which is 'invalid session token'.

  parse.request( )
  :response(function( ok, res, info )
    if res.code == 209 then
      --session is gone
      --need a relogin

Get an Object by ID

  curl -X GET \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \

Another simple one:

  parse.request( parse.Object.get, "GameScore", "Ed1nuqPvcm" )

Create an Object with raw JSON

  curl -X POST \
    -H "X-Parse-Application-Id: aOeTz9iwexrJOh7a9mE9ZzE2swBpQP3fwgp82cdV" \
    -H "X-Parse-REST-API-Key: ZbtvAjlxJ5obTDTwkG44FWYeepdaXJvNnxAFIDKr" \
    -H "Content-Type: application/json" \
    -d '{"playerName":"develephant","cheatMode":false}' \

Generally you would use Lua tables in the plugin, but in certain cases it may be easier just to use the straight JSON.

  parse.request( parse.Object.create, "GameScore" )


For literal strings in Lua, you must enclose the content with double brackets on each end of the text [[some string content]]. Remember that spaces will be preserved so you need to make sure you keep the brackets in tight around the content.

Query an Object with raw JSON

  curl -X GET \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \
    -G \
    --data-urlencode 'where={"playerName":"develephant","cheatMode":false}' \

Even though it's --data--urlencode, the where= takes precedence, so you would use a :where() method. Now, the key to using raw JSON in a :where() method is making sure there are no spaces between the double brackets, or the call will fail.

  parse:request( parse.Object.query, "GameScore" )


In most cases you should use Lua tables for data, it's better for conversion and error handling. Plus you have a table.

Creating an Installation

  curl -X POST \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \
    -H "Content-Type: application/json" \
    -d '{
          "deviceType": "ios",
          "deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
          "channels": [
        }' \

This is a little more of a challenge and may work best with raw JSON, but we'll convert to tables instead:

  parse.request( parse.Installation.create )
    deviceType = "ios",
    deviceToken = "0123456789abcdef0123456789ab",
    channels = {

Sign up and login with Twitter

  curl -X POST \
    -H "X-Parse-Application-Id: 9Ad8ugrxMiwTpgzH7IG7fjKsE07Xevroofy3fS1K" \
    -H "X-Parse-REST-API-Key: bgc8cqUdipxZDyPINvilTg5vacyivf8bJ1VQcH2I" \
    -H "X-Parse-Revocable-Session: 1" \
    -H "Content-Type: application/json" \
    -d '{
          "authData": {
            "twitter": {
              "id": "12345678",
              "screen_name": "ParseIt",
              "consumer_key": "SaMpLeId3X7eLjjLgWEw",
              "consumer_secret": "SaMpLew55QbMR0vTdtOACfPXa5UdO2THX1JrxZ9s3c",
              "auth_token": "12345678-SaMpLeTuo3m2avZxh5cjJmIrAfx4ZYyamdofM7IjU",
              "auth_token_secret": "SaMpLeEb13SpRzQ4DAIzutEkCE2LBIm2ZQDsP3WUU"
        }' \

In Lua...

  local data_tbl =
    authData = {
      twitter = {
        id = "12345678",
        screen_name = "ParseIt",
        consumer_key = "SaMpLeId3X7eLjjLgWEw",
        consumer_secret = "SaMpLew55QbMR0vTdtOACfPXa5UdO2THX1JrxZ9s3c",
        auth_token = "12345678-SaMpLeTuo3m2avZxh5cjJmIrAfx4ZYyamdofM7IjU",
        auth_token_secret = "SaMpLeEb13SpRzQ4DAIzutEkCE2LBIm2ZQDsP3WUU"

  parse.request( parse.User.create )
  :data( data_tbl )