Getting user's friends from facebook


i’m using the accounts-facebook / accouts-ui, and i set it up to get a permission for the user’s friends.
now i want to use the Accounts.onCreateUser to get the friends array, but im a bit confused on how to do it in meteor.

Does anybody have a code to acess the users’ friend using fb access token?

i wrote something like that -
Accounts.onLogin(() => {
onsole.log(‘onCreation called’);
var userId1 = Meteor.userId();
const user = Meteor.users.findOne(userId1);
const fbAccessToken =;
const fbId =;
GET /v2.9/{fbId}/friend HTTP/1.1;
Host: graph.facebook.commeteor;