I am using Google's Spreadsheets API in NodeJS and I know how I can create a Spreadsheet with the following code
const auth = new GoogleAuth({
keyFile: 'src/credentials.json',
scopes: "https://www.googleapis.com/auth/spreadsheets"
})
const client = await auth.getClient()
const googleSheets = google.sheets({version:"v4", auth: client})
let resource = {
properties: {
title: 'Test'
},
}
googleSheets.spreadsheets.create(
{
resource,
fields: 'spreadsheetId'
},
(err, spreadsheet) =>{
if (err) {
console.log(err);
} else {
console.log(`${JSON.stringify(spreadsheet)}`);
}
}
)
This returns the ID of the Spreadsheet and more information, but my problem is that as much as I have searched, I have not found how to give permissions to an email to access the Spreadsheet.