likegate

Small server-side validation/info for Facebook canvas apps.

likegate

Small server-side validation/info for Facebook canvas apps.

Note: doesn't currently validate whether the request if from within Facebook or not, will be adding this soon though.

npm install likegate
var gate = require('likegate');
 
http.createServer(function(reqres) {
    if (req.method == 'POST') {
        gate(req, function(errfields) {
            console.log(fields.liked); // `true` if the user has liked the page 
            console.log(fields.admin); // `true` if the user is an admin 
        });
    } else {
        res.end('Should be a POST request');
    }
});