GSheets sample
Using the gsheets sample bundle
The gsheets bundle in samples/gsheets
demonstrates the ability of retrieving
all rows where column A is filled. Here is a guide to how to get it working.
Prerequisites
You will need a working nodecg-io
installation. If you have non yet take a
look at installation guide. You may need to
install this bundle, so take a look at the
“Try an included sample”-Guide. It
will also tell you how to log in and how to use the GUI.
You also need:
- Google cloud API OAuth access (client ID, client Secret)
- Grant
Google Sheets API v4
access at the project's dashboard.- Shortcut URL:
https://console.developers.google.com/apis/library/sheets.googleapis.com?project=<project-id>
.
- Shortcut URL:
Note
If you don't have such a key yet, you can generate them like this. As redirect URI add:
Configure the gsheets sample bundle
- In NodeCG, create a new googleapis service instance.
-
Enter the credentials for googleapis:
{ "clientID": "<clientID>", "clientSecret": "<clientSecret>", "scopes": ["https://www.googleapis.com/auth/spreadsheets"] }
After entering it, click save.
Note
You can add multiple scopes if the googleapis instance is used for multiple bundles.
-
Set the sample's (
gsheets
) dependency to be the newly created service instance (of typegoogleapis
). -
Check the NodeCG logs:
You should see an error or a success message that is hardcoded in
samples/gsheets/extension/index.ts
.