I'm trying to publish a Shiny app to shinyapps.io but the app requires a Quandl API connection. I don't want to put the API key in my code so I use a .Renviron
file to store the API key.
This is the content of the .Renviron
file:
QUANDL_API_KEY=api_key_goes_here
This is the content of the .Rmd file:
---
title: "Test"
runtime: shiny
output: html_document
---
```{r}
print(Sys.getenv("QUANDL_API_KEY"))
```
When I deploy to shinyapps.io nothing is printed out. But when I run locally, the key is printed. The .Renviron
file is in the app root directory.
What am I doing wrong?