Skip to content

Repository files navigation

gapi-client

Build Status

A very thin Node wrapper for Google's client-side javascript V3 API. For gapi documentation, see Google API Client Reference and for API_KEY, see Google Developers Console.

Install

npm install --save gapi-client

Example

importgapifrom'gapi-client'// Example : Auth2 (synchronous)constinit=()=>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'})gapi.load('client:auth2',init)// Example : Youtube (synchronous)constinit={client: ()=>gapi.client.load('youtube','v3',init.youtube),youtube: ()=>gapi.client.setApiKey('YOUR_API_KEY')}gapi.load('client',init.client)// Example : Youtube (promisified)newPromise(resolve=>gapi.load('client',resolve)).then(()=>newPromise(resolve=>gapi.client.load('youtube','v3',resolve))).then(()=>gapi.client.setApiKey('YOUR_API_KEY'))

License

MIT license.

About

A very thin javascript wrapper for Google's client-side javascript V3 API (gapi)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages