संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google साइन इन क्लाइंट को शुरू करने के बाद, ऐसे हैंडलर अटैच किए जा सकते हैं जो उपयोगकर्ता के सेशन की स्थिति का पता लगाने के लिए, क्लाइंट के अलग-अलग एट्रिब्यूट और तरीकों की जांच करते हैं. क्लाइंट ऑब्जेक्ट से मिली जानकारी का इस्तेमाल करके, उपयोगकर्ता के लिए कई टैब और डिवाइसों पर अपनी साइट के उपयोगकर्ता अनुभव को सिंक किया जा सकता है.
नीचे दिए गए कोड में, 2.0 क्लाइंट तरीके attachClickHandler का इस्तेमाल करके एक कॉलबैक बनाया गया है जो या तो उपयोगकर्ता के लिए, साइन-इन की प्रोसेस को चुपचाप पूरा करता है या उपयोगकर्ता के सेशन की स्थिति के आधार पर, उसे फिर से अनुमति देने का अनुरोध करता है.
/***TheSign-Inclientobject.*/varauth2;/***InitializestheSign-Inclient.*/varinitClient=function(){gapi.load('auth2',function(){/***RetrievethesingletonfortheGoogleAuthlibraryandsetupthe*client.*/auth2=gapi.auth2.init({client_id:'CLIENT_ID.apps.googleusercontent.com'});//Attachtheclickhandlertothesign-inbuttonauth2.attachClickHandler('signin-button',{},onSuccess,onFailure);});};/***Handlesuccessfulsign-ins.*/varonSuccess=function(user){console.log('Signed in as '+user.getBasicProfile().getName());};/***Handlesign-infailures.*/varonFailure=function(error){console.log(error);};
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["The Google Sign-In JavaScript library is deprecated and will eventually be sunset; developers should consult the Deprecation and Sunset guide for migration details and timelines."],["Google Sign-In will require the use of FedCM APIs in the future, so developers should conduct an impact assessment to ensure their sign-in functionality remains unaffected."],["This page provides code demonstrating how to initialize the Google Sign-In client and attach click handlers to manage user sign-in and session state."],["Developers can utilize the `auth2` object to handle successful and failed sign-in attempts, accessing user information upon successful authentication."]]],[]]