Facebook API: how to use inside controllers

Enonic version: 6.6.1
OS: Ubuntu 14.04

Is there any way to use Facebook api inside enonic part controllers or services?
I assume you are using require js but I can’t find require.config file to use with facebook instructions https://developers.facebook.com/docs/javascript/howto/requirejs/v2.7

I believe the example you are referring to is using requireJS on the client (browser), not running it on the server? To load a javascript in xp serverside you do not need to think about requirejs itself. Simply place the script in the lib directory and load it using require(‘facebook.js’) or similar.

Thank you! :slight_smile:
I need to use it on the client side, so there is no need to use it in controller