Use facebook sdk from controller

Permalink
hi
i've installed with a package the facebook sdk on my pakage folder.
i need to include the /packages/my_package/vendor/Facebook/autoload.php on the controller of a single page.

if i do this in the sigle page view work :
$root =$_SERVER['DOCUMENT_ROOT'];
      require_once  $root.DIR_REL.'/packages/my_package/vendor/Facebook/autoload.php';


but i need to include this from the controller of the single page.
i've try somethink like this but doesn't work
use Concrete\Package\MyPackage;
public function view(){
      $fb = new Facebook\Facebook([
                       'app_id' => '', // Replace {app-id} with your app id
                       'app_secret' => '',
                       'default_graph_version' => 'v2.2',
                       ]);
}

any ideas?
thanks