Polished Now Supports Shiny Rmds
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
tldr: You can now use polished
to secure Rmarkdown documents that use the shiny
runtime. This includes flexdashboards!
For example, if you have a flexdashboard that uses shiny
. e.g.
Your Rmd Shiny App
With a single function call, you can add an authentication layer with prebuilt sign in / registration pages, a user admin dashboard, and many other features. Here is an example sign in page:
Sign In Page
For a while now, polished users have able to use polished
to secure traditional shiny
apps and static documents, but polished
did not support Rmarkdown documents using the shiny
runtime (I’ll
refer to Rmarkdown documents using the shiny
runtime as “Shiny Rmds”). This was unfortunate as Shiny Rmds are popular, and, since the actual
shiny
app is generated behind the scenes by rmarkdown
, adding authentication is not straightforward.
Polished now allows you to secure you Shiny Rmd by calling the polished::secure_rmd()
function. Make sure you have the
development version of polished installed before trying it out. You can install it with:
remotes::install_github("tychobra/polished")
Here is a full example:
- code: https://github.com/Tychobra/polished_example_apps/tree/master/09_rmarkdown
- live app: https://demo9.polished.tech/
You can sign into the above live app with:
- email: [email protected]
- password: polished
The polished::secure_rmd()
function takes the shiny
app generated by the your Shiny Rmd, and wraps polished authentication
around it. You can specify the arguments to secure_rmd()
in your Shiny Rmd YAML header, or you can pass the arguments
to the secure_rmd()
function directly.
You can then deploy your app anywhere you can host a regular shiny
app, including Polished Hosting. To deploy to Polished Hosting, use
the polished::deploy_app()
function the same way you would deploy a regular shiny
app.
Additional docs available here:
- secure_rmd: https://polished.tech/docs/rmarkdown-auth
- deployment: https://polished.tech/docs/08-rmarkdown
Please get is touch if you have questions or feedback! I’d love to hear from you.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.