प्रोफ़ाइल की जानकारी फ़ेच की जा रही है

डिफ़ॉल्ट दायरों का इस्तेमाल करके, किसी उपयोगकर्ता के Google खाते में साइन इन करने के बाद, उसका Google आईडी, नाम, प्रोफ़ाइल का यूआरएल, और ईमेल पता ऐक्सेस किया जा सकता है.

किसी उपयोगकर्ता की प्रोफ़ाइल की जानकारी पाने के लिए, 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());
}