Skip to content

commonly-ts/trivious-sheets

Repository files navigation

Trivious Sheets

Google Sheets API wrapper module for Trivious framework


Installation

npm install @trivious/sheets
pnpm add @trivious/sheets
yarn add @trivious/sheets

Requires Node.js 18+


Quick Start

This module is intended to be used with a Google Service Account, refer to Google Cloud Documentation on how to create one.

Google Sheets URL Guide

import { SheetsClient } from "@trivious/sheets";

const sheets = new SheetsClient({
  spreadsheetId: "1ABCefG",
  // Key credentials can be loaded in however you like as long as the client email and private key are passed
  // To get these credentials, create a new key on the service account and download the JSON file
  key: {
    client_email: "account@project.iam.gserviceaccount.com",
    private_key: "-----BEGIN PRIVATE KEY-----\nABC123"
  }
});

await sheets.appendRow({
  sheetName: "Sheet 1",
  columns: { from: "A", to: "C" },
  values: [["Hello", "World"]]
});

About

Google Sheets API wrapper module for Trivious framework

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •