browser-samples icon indicating copy to clipboard operation
browser-samples copied to clipboard

How to import the gapi library for using in a react app?

Open arunkumar413 opened this issue 1 year ago • 1 comments

Summary

Hi Team,

I was referring this doc https://github.com/googleworkspace/browser-samples/blob/main/sheets/quickstart/index.html but it doesn't contain the information on how to include/import the gapi library.

arunkumar413 avatar Aug 08 '23 07:08 arunkumar413

Also the documentation isn't clear on various scopes available. How do mention the scopes if I want to create and write some data to a spreadsheet.

 ` const SCOPES = 'https://www.googleapis.com/auth/spreadsheets.readonly';`

In the below snippet is the callback a string or a function?

     function gisLoaded() {
        tokenClient = google.accounts.oauth2.initTokenClient({
          client_id: CLIENT_ID,
          scope: SCOPES,
          callback: '', // defined later
        });
        gisInited = true;
        maybeEnableButtons();
      }

Is there a detailed documentation on the methods and variables available in the two libraries referred here?

   <script async defer src="https://apis.google.com/js/api.js" onload="gapiLoaded()"></script>
    <script async defer src="https://accounts.google.com/gsi/client" onload="gisLoaded()"></script>

arunkumar413 avatar Aug 08 '23 11:08 arunkumar413