The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Google API Setup
Mark Edmondson
2024-05-22
Install
googleAuthR is available on CRAN
install.packages("googleAuthR")
If you want to use the development version on Github, install
via:
remotes::install_github("MarkEdmondson1234/googleAuthR")
Set up steps
- Create a Google Cloud Project. You will also need billing attached
if the API needs it.
- Set up your project in the Google API Console to use the Google API
you want:
For local use
- Click ‘Create a new Client ID’, and choose “Installed
Application”.
- Download the client JSON file
- Set the
GAR_CLIENT_JSON
environment argument (via
.Renviron
or otherwise) to the full path file location of
the JSON file (see gar_set_client()
for other options)
For Shiny use
- Click ‘Create a new Client ID’, and choose “Web Application”.
- Download the web client JSON file
- Add the URL of where your Shiny app will run to the credentials,
with no port number.
e.g.
https://your-account.shinyapps.io/your-shiny-app/
- And/Or also put in localhost or 127.0.0.1 with a port number for
local testing. Remember the port number you use as you will need it
later to launch the app e.g.
http://127.0.0.1:1221
- Set the
GAR_CLIENT_WEB_JSON
environment argument (via
.Renviron
or otherwise) to the full path file location of
the JSON file (see gar_set_client()
for other options)
- Run the app locally specifying the port number you used
e.g.
shiny::runApp(port=1221)
- Or deploy to your Shiny Server that deploys to web port (80 or
443).
Activate API
- In the Google Cloud Platform Click on “APIs” menu to the left
- Select and activate the API you want to use.
- Go to the documentation and find the API scope URL
- Set option in your R script for the scope via
gar_set_client()
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.