Developer Guide

In Extend, there is a context object available with quite a few useful properties that can be accessed while running your tasks.

var context = {
  body,
  meta,
  storage,
  query,
  secrets,
  headers
};

Body

The body property will contain either application/json or application/x-www-form-urlencoded parsed data. Note that if you wish to work with the raw body of the request or binary data, you should use the function(cb, req, res) form of the extension.

Meta

The meta property is an object containing the metadata properties of the task being executed, or an empty object if there are none.

Storage

The storage property is an instance of the storage interface. The context.storage.get and the context.storage.set methods can be used to access or store items. See the storage interface documentation for more details.

Query

The query parameter is the parsed query-string. It is parsed using querystring, so it does not support the dot syntax that things like qs support.

Secrets

The secrets parameter is an object containing extension secrets (or an empty object, if there are none). Secrets provide a place to securely store private information, such as tokens or IDs.

Headers

The headers parameter contains the unmodified headers from the request received by the extension sandbox.