0.1.55 • Published 1 year ago

@webcontext/google v0.1.55

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

1 year ago

0.1.53

1 year ago

0.1.54

1 year ago

0.1.55

1 year ago

0.1.50

1 year ago

0.1.51

1 year ago

0.1.49

1 year ago

0.1.48

1 year ago

0.1.45

1 year ago

0.1.46

1 year ago

0.1.47

1 year ago

0.1.42

1 year ago

0.1.43

1 year ago

0.1.44

1 year ago

0.1.41

1 year ago

0.1.40

1 year ago

0.1.38

1 year ago

0.1.39

1 year ago

0.1.36

1 year ago

0.1.35

1 year ago

0.1.34

1 year ago

0.1.33

1 year ago

0.1.32

1 year ago

0.1.31

1 year ago

0.1.30

1 year ago

0.1.29

1 year ago

0.1.28

1 year ago

0.1.27

1 year ago

0.1.26

1 year ago

0.1.25

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.1

1 year ago