ganesshkumar / gapi-client

🗺 A very thin wrapper for Google's client-side javascript V3 API

Home Page:https://www.npmjs.com/package/gapi-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gapi-client

A very thin wrapper for Google's client-side javascript V3 API.

Example

npm install --save gapi-client

index.js:

import gapi from 'gapi-client';

//On load, called to load the auth2 library and API client library.
gapi.load('client:auth2', initClient);

// Initialize the API client library
function initClient() {
  gapi.client.init({
    discoveryDocs: ["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"],
    clientId: 'YOUR_CLIENT_ID',
    scope: 'https://www.googleapis.com/auth/drive.metadata.readonly'
  }).then(function () {
    // do stuff with loaded APIs
    console.log('it worked');
  });
}

License

MIT © Kevin Schaich

About

🗺 A very thin wrapper for Google's client-side javascript V3 API

https://www.npmjs.com/package/gapi-client

License:MIT License