Last active
December 10, 2019 11:28
-
-
Save jackrobertscott/378290c354617c81e54278672fa5d09f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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