Skip to content

Instantly share code, notes, and snippets.

@jackrobertscott
Last active December 10, 2019 11:28
Show Gist options
  • Save jackrobertscott/378290c354617c81e54278672fa5d09f to your computer and use it in GitHub Desktop.
Save jackrobertscott/378290c354617c81e54278672fa5d09f to your computer and use it in GitHub Desktop.
import axios from 'axios';
async function getFacebookUserData(access_token) {
const { data } = await axios({
url: 'https://graph.facebook.com/me',
method: 'get',
params: {
fields: ['id', 'email', 'first_name', 'last_name'].join(','),
access_token: accesstoken,
},
});
console.log(data); // { id, email, first_name, last_name }
return data;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment