I have a Shiny app making use of the googlesheets
package which requires the user to authenticate for writing to Google Sheets (despite the Sheet being public and "published to the web"). This is done graphically in a browser, and works when the Shiny app is run locally. However, when deployed on shinyapps.io, the authentication call crashes the app and logs an error:
Warning: Error in : oauth_listener() needs an interactive environment.
So, what options are there? I'm thinking it would be a bad idea to upload my own .httr-oauth
file or token to shinyapps.io... Any workarounds?
Publish your Shiny App to RStudio ConnectAt the top of the editor, click Publish. In the Publish to Server window, confirm that your account is shown in the Publish To Account section and click Publish. You can monitor the status of the deployment in the RStudio IDE Deploy pane.
In case anyone else has a problem with this, the new {googlesheets4}
provides a solution:
https://googlesheets4.tidyverse.org/articles/articles/auth.html
If you don’t need to access private Sheets, use gs4_deauth() to indicate there is no need for a token. This puts googlesheets4 into a de-authorized mode.
(an example script is also included)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With