If you're developing a standalone client application, not a website, I wouldn't try to use their Javascript API, because it assumes it's being run on some website.
You might have more luck with the unofficial Node.js APIs, seeing as node-webkit allows you to make calls to any Node.js library from within the DOM.
If you still have no success, try letting the user log into Facebook itself, presenting its login page in an <iframe>
. Then you might be able to make HTTP calls, either through AJAX or through Node.js HTTP APIs, to call Facebook's internal APIs directly.