Api keys renv
API Keys let us make authenticated requests from the RStudio IDE to Connect.
We are going to add our API credentials to a .Renviron
file, making them available to R as environment variables.
- Navigate to Connect and create and copy your API Key.
- Return to the RStudio IDE.
- Use an
.Renviron
file to set theCONNECT_SERVER
andCONNECT_API_KEY
environment variables:- In the Console, type
usethis::edit_r_environ()
and press Enter to open your .Renviron for editing. - Add the following:
CONNECT_SERVER=<https://your-server-address.com/> CONNECT_API_KEY=<paste key value>
- Save and close the file.
- In the Console, type
- Restart R:
- Mac: Cmd + Shift + F10
- PC/Linux: Ctrl + Shift + F10