-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
28 lines (22 loc) · 690 Bytes
/
client.js
File metadata and controls
28 lines (22 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { GoogleSpreadSheetsApi } = require("./out/index");
require("dotenv").config();
const crypto = require("crypto");
const googleSheetsApi = new GoogleSpreadSheetsApi({
spreadSheetId: process.env.SPREAD_SHEET_ID,
scope: "write",
credentials: {
clientEmail: process.env.GCP_CLIENT_EMAIL,
privateKey: process.env.GCP_PRIVATE_KEY,
},
});
const start = async () => {
// const insertedRowResponse = await googleSheetsApi.insertRow([
// crypto.randomBytes(16).toString("hex"),
// "hello@world.com",
// "123456789",
// ]);
const rows = await googleSheetsApi.getRows();
console.log(rows);
console.log("The operation went successful ✅");
};
start();