@invisible/google-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@invisible/google-api

This package wraps the complexity of Google's auth for service workers and returns authorized googleapis with some helpers.

How to use this package?

  1. You need to pass auth token and scopes(optional, spreadsheets by default) as parameters to .authorize() or as environmental variables:
# GOOGLE_SERVICE_ACCOUNT_B64 is the JSON service worker credentials encoded in base64.
GOOGLE_SERVICE_ACCOUNT_B64
# SCOPES is a comma separated list of scopes.
SCOPES
  • You can add environmental variables to your .env file (env.sample as example)
  1. API:
import google from '@invisible/google-api'

const { sheets } = await google.authorize(GOOGLE_SERVICE_ACCOUNT_B64, SCOPES)

sheets.getSheet(spreadsheetId, range)

Publish to NPM

npm run build
npm publish

Readme

Keywords

none

Package Sidebar

Install

npm i @invisible/google-api

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

82.3 kB

Total Files

15

Last publish

Collaborators

  • brittonware
  • juliendemarque
  • chancellorrr
  • adamhaney-invisible
  • nadeeminv
  • gtaltemann
  • elseagle
  • invisible-bot
  • rodrigo4244
  • scottdownes
  • zacksingh
  • el5091