The ID of the Google Sheets spreadsheet where the new sheet will be added.
The title for the new sheet.
const spreadsheetId = 'your_spreadsheet_id_here';
const sheetTitle = 'New Sheet Title';
(async () => {
try {
const response = await createNewSheet(spreadsheetId, sheetTitle);
console.log('New Sheet Created:', response);
} catch (error) {
console.error(error);
}
})();
Generated using TypeDoc
Creates a new sheet within an existing Google Sheets spreadsheet.
This function uses the Google Sheets API to create a new sheet within a specified spreadsheet. It requires the spreadsheet ID where the new sheet will be added and the title for the new sheet. The function assumes that the 'GOOGLE_APPLICATION_CREDENTIALS' environment variable is set with the path to the Google service account credentials JSON file.
Set up the 'GOOGLE_APPLICATION_CREDENTIALS' environment variable: export GOOGLE_APPLICATION_CREDENTIALS=path_to_your_credentials.json