# @tomwaferry/google.api.helper

> Helper module for interacting with Google APIs

Latest version **1.0.3** (published 2020-03-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @tomwaferry/google.api.helper
pnpm add @tomwaferry/google.api.helper
yarn add @tomwaferry/google.api.helper
bun add @tomwaferry/google.api.helper
```

## 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.3 |
| Published | 2020-03-12 |
| First published | 2019-10-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tomwaferry |

## Links

- npm: https://www.npmjs.com/package/@tomwaferry/google.api.helper
- npm.io page: https://npm.io/package/@tomwaferry/google.api.helper

## Dependencies (1)

- [googleapis](https://npm.io/package/googleapis.md) ^44.0.0

## Recent versions

- 1.0.3 (latest) — 2020-03-12
- 1.0.2 — 2019-10-24
- 1.0.1 — 2019-10-24
- 1.0.0 — 2019-10-24

## README

## Google API helper module

Simple module for interacting with Google APIs.

### Initialising

You'll need a service to service authentication JSON file to authenticate requests. You can generate one from the (Google Cloud Console)[https://console.cloud.google.com/home/dashboard?project=entee.co.uk:api-project-577903765002].

Require that in and create a new instance of the Google Helper with your key.

```js
const googleHelper = require('@tomwaferry/google.api.helper');
const key = require('/path-to-service-account.json');
const google = new googleHelper(key);
```

## Methods

The following methods are available and all return promises:
1. readGoogleSheet
2. appendGoogleSheet
3. clearGoogleSheet
4. batchUpdateGoogleSheet
5. uploadGoogleDriveImage
6. listDriveFolderContents
7. getSearchConsoleData

Remember to grant your service account permissions on the applicable resources.

## Usage

All methods return promises, and can be used like so:

```js
// Promises
google.readGoogleSheet('spreadsheetId', 'Sheet1', 'A:E').then(data => {
    // do something with the data
});

// Async Await
async function(){
    const data = await google.readGoogleSheet('spreadsheetId', 'Sheet1', 'A:E');
    // do something with the data
}
```

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