0.1.55 • Published 8 months ago

@webcontext/google v0.1.55

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

User Manual for Google Cloud API Helper Functions for Webcontext Users

Prerequisites

  1. Environment Variables: Add the following environment variables to a .env file in the project root. Ensure the 'dotenv' package is installed to load these variables:
GOOGLE_CLOUD_PROJECT_ID
GOOGLE_CLOUD_CLIENT_EMAIL
GOOGLE_CLOUD_PRIVATE_KEY
  1. Google Cloud Setup: Ensure that the Google Cloud API client email is added as an editor to any Google Sheet that the helper functions will modify.

Available APIs

  • Sheets API: Provides helper functions for managing Google Sheets data.

Available helper functions for sheets

  1. Function: updateSheets
  • Description: This function updates data in a Google Spreadsheet, specified by a unique spreadsheetId, with given headers and rows of data.

  • Arguments:

    • obj: An object containing headers and values.

      • headers: An array of strings representing the column headers for the sheet. Example: ['Category', 'Item', 'Quantity'].
      • values: A 2D array where each inner array represents a row of data, aligning with the headers. Example: [['Electronics', 'Laptop', '15'], ['Appliances', 'Toaster', '5']].
    • spreadsheetId: A string representing the unique identifier of the Google Spreadsheet (found in the Google Sheets URL after /d/ and before /edit).

Note: The Google Cloud API client e mail must have editor permissions on the target spreadsheet.

Example usage

import sheets from './services/sheets.js';

const data = {
  headers: ['Category', 'Item', 'Quantity'],
  values: [
    ['Electronics', 'Laptop', '15'],
    ['Appliances', 'Toaster', '5'],
  ],
};

const spreadsheetId = 'your_spreadsheet_id_here';
0.1.52

8 months ago

0.1.53

8 months ago

0.1.54

8 months ago

0.1.55

8 months ago

0.1.50

8 months ago

0.1.51

8 months ago

0.1.49

8 months ago

0.1.48

8 months ago

0.1.45

8 months ago

0.1.46

8 months ago

0.1.47

8 months ago

0.1.42

9 months ago

0.1.43

9 months ago

0.1.44

9 months ago

0.1.41

9 months ago

0.1.40

9 months ago

0.1.38

9 months ago

0.1.39

9 months ago

0.1.36

9 months ago

0.1.35

9 months ago

0.1.34

9 months ago

0.1.33

9 months ago

0.1.32

9 months ago

0.1.31

9 months ago

0.1.30

9 months ago

0.1.29

9 months ago

0.1.28

9 months ago

0.1.27

9 months ago

0.1.26

10 months ago

0.1.25

10 months ago

0.1.24

10 months ago

0.1.23

10 months ago

0.1.22

10 months ago

0.1.21

10 months ago

0.1.20

10 months ago

0.1.19

10 months ago

0.1.18

10 months ago

0.1.17

10 months ago

0.1.16

10 months ago

0.1.15

10 months ago

0.1.14

10 months ago

0.1.13

10 months ago

0.1.12

10 months ago

0.1.11

10 months ago

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.1

11 months ago