https://github.com/os-js/osjs-gapi-provider
OS.js Google API Service Provider
https://github.com/os-js/osjs-gapi-provider
osjs osjs-provider
Last synced: 11 months ago
JSON representation
OS.js Google API Service Provider
- Host: GitHub
- URL: https://github.com/os-js/osjs-gapi-provider
- Owner: os-js
- License: other
- Created: 2018-07-12T21:02:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-08-09T22:52:37.000Z (almost 4 years ago)
- Last Synced: 2025-06-06T11:08:51.339Z (12 months ago)
- Topics: osjs, osjs-provider
- Language: JavaScript
- Homepage: https://manual.os-js.org/v3/
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[OS.js](https://www.os-js.org/) is an [open-source](https://raw.githubusercontent.com/os-js/OS.js/master/LICENSE) web desktop platform with a window manager, application APIs, GUI toolkit, filesystem abstractions and much more.
[](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)
[](https://opencollective.com/osjs)
[](https://liberapay.com/os-js/)
[](https://paypal.me/andersevenrud)
[](https://community.os-js.org/)
# OS.js Google API Provider
This is the Google API Provider for OS.js.
## Installation
```bash
npm install @osjs/gapi-provider
```
In your client bootstrap file (`src/client/index.js`):
```javascript
import {GapiServiceProvider} from '@osjs/gapi-provider';
osjs.register(GapiServiceProvider, {
args: {
// These are set for you by default
src: 'https://apis.google.com/js/api.js',
libraries: 'client:auth2',
timeout: 30000,
// You have to define these
client: {
apiKey: '',
clientId: '',
discoveryDocs: [],
scope: []
}
}
});
```
## Usage
For example in an application:
```javascript
const osjsgapi = core.make('osjs/gapi').create();
osjsgapi.on('signed-in', () => console.log('You were signed in'));
osjsgapi.on('signed-out', () => console.log('You were signed out'));
osjsgapi.login().then(gapi => {
// Do whatever
});
proc.on('destroy', () => osjsgapi.destroy());
```
## Contribution
* **Sponsor on [Github](https://github.com/sponsors/andersevenrud)**
* **Become a [Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)**
* **Support on [Open Collective](https://opencollective.com/osjs)**
* [Contribution Guide](https://github.com/os-js/OS.js/blob/master/CONTRIBUTING.md)
## Documentation
See the [Official Manuals](https://manual.os-js.org/) for articles, tutorials and guides.
## Links
* [Official Chat](https://gitter.im/os-js/OS.js)
* [Community Forums and Announcements](https://community.os-js.org/)
* [Homepage](https://os-js.org/)
* [Twitter](https://twitter.com/osjsorg) ([author](https://twitter.com/andersevenrud))
* [Google+](https://plus.google.com/b/113399210633478618934/113399210633478618934)
* [Facebook](https://www.facebook.com/os.js.org)
* [Docker Hub](https://hub.docker.com/u/osjs/)