All works well when I am running the app on my development computer [I was wrong here.], but when I deploy to shinyapps.io I get this error:
Error in value[[3L]](cond) : Can't get Google credentials.
Are you running googlesheets4 in a non-interactive session? Consider:
* `sheets_deauth()` to prevent the attempt to get credentials.
* Call `sheets_auth()` directly with all necessary specifics.
See gargle's "Non-interactive auth" vignette for more details:
https://gargle.r-lib.org/articles/non-interactive-auth.html
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Any suggestions? I'm trying to create a package for instructors to log events from learnr tutorials in order to support the COVID-19 movement to online learning.
I haven't used the gargle package myself but I have authenticated with googlesheets in the past. Has learnrcache-efcb19f92072.json been uploaded to the shinyapps directory? I think that may have been for a one-time session only.
You may want to try googledrive::drive_auth_configure()first to store a key for use in downstream requests. Then you'll use your API key for all requests.
Thanks, Tanya. Indeed I did have learnrcache-efcb19f92072.json uploaded to the shinyapps directory.
I tried your suggestion to use googledrive::drive_auth_configure(), or at least I think I tried it. This is what I did
Went to https://console.cloud.google.com/apis/credentials to create an API key.
Ran oaauth_app()
myapp <- httr::oauth_app(
"markr", # the name of the package implementing the system
key = "the_key_I_got_in_step_1",
"a character string to use as a secret")