MarkEdmondson1234 / searchConsoleR

R interface with Google Search Console API v3, including Search Analytics.
http://code.markedmondson.me/searchConsoleR/
Other
114 stars 41 forks source link

Using searchConsoleR in Shinyapps #54

Closed zatkoma closed 4 years ago

zatkoma commented 5 years ago

Hi Mark, I loved your package, and I try to write small to which download, edit, and make exportable. And I want this tool upload to shinyapps.io for my coworkers which will use it.

But I have problem with usage API at shiny apps

What goes wrong

Warning: Error in : Authentication options didn't match existing session token and not interactive session so unable to manually reauthenticate.

Steps to reproduce the problem

On localhost, I use this code too, and it works. scr_auth(new_user = TRUE)

When pervious command not found i've tried use this one: googleAuthR::gar_auth(new_user = TRUE)

Of course i've setup this options

options("googleAuthR.scopes.selected" = c("https://www.googleapis.com/auth/analytics", 
                                          "https://www.googleapis.com/auth/webmasters"))
options("googleAuthR.client_id" = "")
options("googleAuthR.client_secret" = "")
options("googleAuthR.webapp.client_id" = "")
options("googleAuthR.webapp.client_secret" = "")

But i'm still have the first warning and my app goes down

What can I do better?

MarkEdmondson1234 commented 4 years ago

Sorry for late answer, I suggest reading over the googleAuthR examples here: https://code.markedmondson.me/googleAuthR/articles/google-authentication-types.html#shiny-modules

There is an older example of Shiny app with search console here: https://github.com/MarkEdmondson1234/searchConsoleR/tree/master/inst/examples/shiny_test