# cordova-google-oauth2

> ## Installation

Latest version **1.0.0** (published 2022-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-google-oauth2
pnpm add cordova-google-oauth2
yarn add cordova-google-oauth2
bun add cordova-google-oauth2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-04-24 |
| First published | 2022-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | qertis |
| Maintainers | qertis |
| Keywords | cordova-plugin, oauth-2, google-oauth2 |

## Links

- npm: https://www.npmjs.com/package/cordova-google-oauth2
- Repository: https://github.com/qertis/cordova-google-oauth2
- Homepage: https://github.com/qertis/cordova-google-oauth2#readme
- Issues: https://github.com/qertis/cordova-google-oauth2/issues
- npm.io page: https://npm.io/package/cordova-google-oauth2

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-04-24

## README

# cordova-google-oauth2

## Installation


## Example

```javascript
import googleOAuth from './googleOAuth.js';

const CLIENT_ID = 'xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com';
const scriptId = 'yyyyyyy-yyyyyyyyyyyyyyyyyyyyyyyyy';
const sheetId = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
const SCOPES = [
  'https://www.googleapis.com/auth/drive',
  'https://www.googleapis.com/auth/spreadsheets'
];

googleOAuth(CLIENT_ID, SCOPES, {redirect_uri: 'http://localhost/callback'})
.then((response) => {
  if (response.error) {
    console.error(response);
    return;
  }
  return gapi.client.request({
    'root': 'https://script.googleapis.com',
    'path': `v1/scripts/${scriptId}:run`,
    'method': 'POST',
    'body': {
      'function': 'load',
      'parameters': [sheetId]
    }
  });
})
.then((res) => {
  const resp = JSON.parse(res.body);
  console.log(resp.response);
})
.catch((error) => {
  console.error(error);
});
```

---
_Source: https://npm.io/package/cordova-google-oauth2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
