0.1.55 • Published 5 months ago

@webcontext/google v0.1.55

Weekly downloads
-
License
-
Repository
github
Last release
5 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

5 months ago

0.1.53

5 months ago

0.1.54

5 months ago

0.1.55

5 months ago

0.1.50

5 months ago

0.1.51

5 months ago

0.1.49

5 months ago

0.1.48

5 months ago

0.1.45

6 months ago

0.1.46

6 months ago

0.1.47

6 months ago

0.1.42

6 months ago

0.1.43

6 months ago

0.1.44

6 months ago

0.1.41

6 months ago

0.1.40

6 months ago

0.1.38

6 months ago

0.1.39

6 months ago

0.1.36

7 months ago

0.1.35

7 months ago

0.1.34

7 months ago

0.1.33

7 months ago

0.1.32

7 months ago

0.1.31

7 months ago

0.1.30

7 months ago

0.1.29

7 months ago

0.1.28

7 months ago

0.1.27

7 months ago

0.1.26

7 months ago

0.1.25

7 months ago

0.1.24

7 months ago

0.1.23

7 months ago

0.1.22

7 months ago

0.1.21

7 months ago

0.1.20

7 months ago

0.1.19

7 months ago

0.1.18

7 months ago

0.1.17

7 months ago

0.1.16

7 months ago

0.1.15

7 months ago

0.1.14

7 months ago

0.1.13

7 months ago

0.1.12

7 months ago

0.1.11

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

8 months ago

0.0.1

8 months ago