0.1.0 • Published 6 years ago
gapi-snapshot v0.1.0
gapi-snapshot
1 - Overview
This node package is the minimal wrapper on the Google client side Javascript lib gapi.js , as this library seems to be available only on CDNs.
As gapi.js may be updated any time I added a snapshot date to the node package.
2 - Install
From terminal:
$ npm install gapi-snapshot
3 - User Guide
See gapi official doc.
Exemple:
import gapi from './gapi-snapshot';
// Loads the client library and the auth2 library together for efficiency.
// Loading the auth2 library is optional here since `gapi.client.init` function will load
// it if not already loaded. Loading it upfront can save one network request.
gapi.load('client:auth2', initClient);
// Initialize the client with API key and People API, and initialize OAuth with an
// OAuth 2.0 client ID and scopes (space delimited string) to request access.
gapi.client.init({
'apiKey': 'YOUR_API_KEY',
'discoveryDocs': ['https://people.googleapis.com/$discovery/rest'],
'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com',
'scope': 'profile',
}).then(function() {
// after you enter your credentials in a Google popup
console.log('authenticated');
// display credentials
console.log(gapi.auth.getToken());
};
4 - Context
This wrapper is used in ...
0.1.0
6 years ago