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

डिफ़ॉल्ट स्कोप का इस्तेमाल करके 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());
}