# browser-google-auth

> A simple google authentication that launches browser and return auth token

Latest version **1.1.0** (published 2021-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install browser-google-auth
pnpm add browser-google-auth
yarn add browser-google-auth
bun add browser-google-auth
```

## 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.1.0 |
| Published | 2021-12-01 |
| First published | 2021-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sanjay Vamja |
| Maintainers | svamja |
| Keywords | google, auth, oauth2, authentication, browser, desktop, command line |

## Links

- npm: https://www.npmjs.com/package/browser-google-auth
- Repository: https://github.com/svamja/browser-google-auth
- Homepage: https://github.com/svamja/browser-google-auth#readme
- Issues: https://github.com/svamja/browser-google-auth/issues
- npm.io page: https://npm.io/package/browser-google-auth

## Dependencies (6)

- [fs](https://npm.io/package/fs.md) 0.0.1-security
- [url](https://npm.io/package/url.md) ^0.11.0
- [http](https://npm.io/package/http.md) 0.0.1-security
- [open](https://npm.io/package/open.md) ^8.0.4
- [server-destroy](https://npm.io/package/server-destroy.md) ^1.0.1
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^7.0.3

## 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
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-12-01
- 1.0.0 — 2021-03-29

## README

# Browser-based Google Auth using NodeJS

A simple google authentication workflow that launches 
browser and return auth token, in the NodeJS script.

## How to use

    const BrowserGoogleAuth = require('browser-google-auth');
    const credPath = __dirname + '/.google_credentials.json'; // required
    const tokenPath =  __dirname + '/.google_token.json'; // optional
    const scope = [
      'https://www.googleapis.com/auth/spreadsheets',
      'https://www.googleapis.com/auth/drive',
    ];
    BrowserGoogleAuth.setOptions({ tokenPath, credPath, scope });
    let auth = await BrowserGoogleAuth.getClient();


## Callback URL

Add below callback URL through Google Console

    http://localhost:3000/auth/callback

or change it using option parameters { domainRoot, port, callbackPath }

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