প্রোফাইলের তথ্য পাওয়া যাচ্ছে

আপনি ডিফল্ট স্কোপগুলি ব্যবহার করে Google-এর সাথে কোনও ব্যবহারকারীকে সাইন ইন করার পরে, আপনি ব্যবহারকারীর Google ID, নাম, প্রোফাইল URL এবং ইমেল ঠিকানা অ্যাক্সেস করতে পারেন৷

ব্যবহারকারীর জন্য প্রোফাইল তথ্য পুনরুদ্ধার করতে, getBasicProfile() পদ্ধতি ব্যবহার করুন। উদাহরণ স্বরূপ:

// auth2 is initialized with gapi.auth2.init() and a user is signed in.

if (auth2.isSignedIn.get()) {
  var profile = auth2.currentUser.get().getBasicProfile();
  console.log('ID: ' + profile.getId());
  console.log('Full Name: ' + profile.getName());
  console.log('Given Name: ' + profile.getGivenName());
  console.log('Family Name: ' + profile.getFamilyName());
  console.log('Image URL: ' + profile.getImageUrl());
  console.log('Email: ' + profile.getEmail());
}