Boot idle users off your shiny server :zzz:
You can install the development version of idler from GitHub with:
# install.packages("devtools")
devtools::install_github("grddavies/idler")
How to use idler to manage user sessions in your Shiny app:
library(shiny)
ui <- function(){
tagList(
idler::use_idler(),
tags$h1("idler demo")
)
}
server <- function(input, output, session) {
# Boot idle users after 2s
idler::set(2)
}
shinyApp(ui, server)
The JavaScript event listeners at idler
's core are lifted straight from this stack exchange answer. Credit for that (crucial) bit of functionality goes to Pork Chop
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.