https://github.com/mgechev/google-oauth2-node
Client for OAuth2 authentication for Google APIs (Google Analytics, GMail, Google Docs, etc.)
https://github.com/mgechev/google-oauth2-node
google google-api oauth2
Last synced: about 1 year ago
JSON representation
Client for OAuth2 authentication for Google APIs (Google Analytics, GMail, Google Docs, etc.)
- Host: GitHub
- URL: https://github.com/mgechev/google-oauth2-node
- Owner: mgechev
- Created: 2018-04-02T05:02:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-28T23:18:37.000Z (over 7 years ago)
- Last Synced: 2025-05-08T22:43:01.666Z (about 1 year ago)
- Topics: google, google-api, oauth2
- Language: TypeScript
- Homepage:
- Size: 20.5 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js Google OAuth2 Client
Using this client you can get a refresh and access tokens for using Google APIs. The client is specifically designed to be used in node.js, as an "Installed Application".
## Installation
```bash
npm i google-oauth2-node --save
```
## Usage
```ts
import { auth } from 'google-oauth2-node';
const clientId = '...';
const clientSecret = '...';
const scope = 'https://www.googleapis.com/auth/analytics.readonly';
auth({ clientId, clientSecret, scope }).then(res => console.log(res), err => console.error(err));
```
## License
MIT