@trivious/sheets
v1.0.1
Published
Google Sheets API wrapper module for Trivious framework
Downloads
155
Readme
Trivious Sheets
Google Sheets API wrapper module for Trivious framework
Installation
npm install @trivious/sheets
pnpm add @trivious/sheets
yarn add @trivious/sheetsRequires 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.
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: "[email protected]",
private_key: "-----BEGIN PRIVATE KEY-----\nABC123"
}
});
await sheets.appendRow({
sheetName: "Sheet 1",
columns: { from: "A", to: "C" },
values: [["Hello", "World"]]
});