0.1.55 • Published 6 months ago

@webcontext/google v0.1.55

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

6 months ago

0.1.53

6 months ago

0.1.54

6 months ago

0.1.55

6 months ago

0.1.50

6 months ago

0.1.51

6 months ago

0.1.49

6 months ago

0.1.48

6 months ago

0.1.45

6 months ago

0.1.46

6 months ago

0.1.47

6 months ago

0.1.42

7 months ago

0.1.43

7 months ago

0.1.44

7 months ago

0.1.41

7 months ago

0.1.40

7 months ago

0.1.38

7 months ago

0.1.39

7 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

8 months ago

0.1.27

8 months ago

0.1.26

8 months ago

0.1.25

8 months ago

0.1.24

8 months ago

0.1.23

8 months ago

0.1.22

8 months ago

0.1.21

8 months ago

0.1.20

8 months ago

0.1.19

8 months ago

0.1.18

8 months ago

0.1.17

8 months ago

0.1.16

8 months ago

0.1.15

8 months ago

0.1.14

8 months ago

0.1.13

8 months ago

0.1.12

8 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

9 months ago

0.0.1

9 months ago