Almost all applications require users to create accounts on their websites to use services. Now a days every websites give support to social media application such as Google, Facebook, Instagram to authenticate user. So this library helps you to get unique id of user's social media account.
As of now, library support 3 popular social media account to integrate
To start using this library, you must include it in your project and then you can either use the callback function or through the async await :
let { social_accounts } = require('social-authenticate');
1) Using Callback:
social_accounts(type, params).then(response => console.log(response));
2) Using async await:
let response = await social_accounts(type, params);
For Facebook:
let type = "facebook"
let parameters = {
token: "x1904new0rkvnfnewui"
}
For Instagram:
let type = "instagram"
let parameters = {
token: "x1904new0rkvnfnewui"
}
For Google:
let type = "google"
let parameters = {
token: "x1904new0rkvnfnewui",
audiance: ["asdnaksdadsoiq"] //It should be in array and can give multiple values in audiance
}
If you pass valid parameters and proper values then you will response like:
{
status: 200
data: {
social_account_id: "1231231321331"
}
}