Talk to a remote API without needing to expose your secret token or all the endpoints
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 9 commits behind jorgepedret:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Talk to a remote API without needing to expose your secret token or all the API endpoints

The problem

Distillery was created to secure the communication with a remote APIs from the browser.

To talk to public APIs, (i.e.: Instagram, Twitter, etc.) you need a secret token which gives you access to the API endpoints. You can't let other people know about this secret token, or they could do nasty things to your account.

Distillery is a NodeJS library that proxies the API calls through, while hiding your secret token. You can also specify what methods and specific endpoints you want to deny or allow access to.

Instagram API Example

Example configuration:

// destillery.json
  "instagram": {
    "remoteUrl": "",
    "auth": {
      "method": "get",
      "key": "client_id",
      "value": "cfxxxxxxxxxxxxxxxxxxxxxxxxxxxx13"
    "deny": {
      "methods": ["post"],
      "paths": [ "users/search" ]

Run the server:

$ node server.js
Distillery is running on port 3000

Or use it like a library:

var express     = require("express"),
    app         = express(),
    distillery  = require("distillery")(config.distillery, app);

Consume the API:

$ curl "http://localhost:3000/instagram/media/popular"
  "meta": {
    "code": 200
  "data": [
      "attribution": null,
      "tags": [],
      "location": null,
      "comments": {
        "count": 48,
        "data": [

Trying to access blocked paths or methods will return a 404 error:

$ curl "http://localhost:3000/instagram/users/search?q=jorge"
  "error": "Endpoint not found"


  • Add distillery to NPM list
  • Support standard (and popular APIs) ways of authenticating
  • Improve the way deny/allow works
  • Switch to a lighter HTTP server (replace express)