// Facebook Login with JavaScript SDK
function launchWhatsAppSignup() {
// Launch Facebook login
FB.login(function (response) {
if (response.authResponse) {
const accessToken = response.authResponse.accessToken;
//Use this token to call the debug_token API and get the shared WABA's ID
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {
config_id: '', // configuration ID obtained in the previous step goes here
response_type: 'code', // must be set to 'code' for System User access token
override_default_response_type: true,
extras: {
setup: {
... // Prefilled data can go here
}
}
});
}