To access data from a Google Sheet with your app, you will need to create a service account and download a credentials file from the Google API Console.
- Create a Google spreadsheet.
- Go to the Google APIs Console.
- Create a new project and navigate to it.
- Click Enable APIs and Services. Enable the Google Drive API.
- In the Create credentials options, select Help me choose. You are using "Google Drive API" from a "Web server" to access "Application data".
- Add credentials to your project. Name the service account and grant it a Role of "Project" > "Editor".
- Download the credentials file (JSON format).
- Copy the credentials file to your code directory and rename it to client_secret.json
- Copy the value of client_email from the credentials file. Back in your spreadsheet, click the Share button in the top right, and paste it into the People field to give it edit rights. Hit Send.