This site uses cookies. Read more.

Update August 2020: We are sorry to inform you that shiny.users package development has been suspended. We currently have no plans to continue development. Although there is significant interest in a Shiny authorization package, the effort to maintain and improve our early release was unsustainable and we decided to use this time on our other open-source packages such as shiny.semantic. Don’t worry though, there are existing tools for user authorization and authentication on the market that you can use: shinyapps.io, Shiny Server Pro, R Studio Connect, auth0 package (with our Auth0 management API), using nginx and several others. If any of the available solutions on the market do not respond to your needs, please contact us – [email protected]. We offer bespoke solutions for enterprise and non-standard Shiny applications.

We decided to share the early release of shiny.stats package that was initially part of shiny.admin package development. It an easy way for logging users activity and adding statistics panel to your Shiny app. [/Update]

At Appsilon we frequently build advanced R/Shiny dashboards that need user authentication. I would like to share with you how we implement user management – user accounts, the authorization process and gather usage statistics to have a better understanding of how the app is used.

For user authentication, we created the shiny.users package. For user administration and usage statistics, we created the shiny.admin package. We will show you a sneak peek of how these packages work. They are not released yet – but we opened an Early Adopter Waitlist – sign up and we will contact you as soon as these packages will be ready for production testing!

Shiny.users – convenient authentication on the application level

Here is an example of how shiny.users works when you add it to your shiny application:

Below you can view the code of this example:


demo_users <- list(
    username = "demo-appsilon", 
    password_sha256 = "A7574A42198B7D7EEE2C037703A0B95558F195457908D6975E681E2055FD5EB9", 
    roles = list("basic", "admin")
    username = "john", 
    password_sha256 = "C2F77349B4D0CDE5A1E865195A9E395E1DF8829BE9D31707BD12F44CEB384A60", 
    roles = list("basic")

ui <- shinyUI(fluidPage(
  div(class = "container", style = "padding: 4em",

server <- shinyServer(function(input, output) {
  users <- initialize_users(demo_users)
  callModule(login_screen, 'login_screen', users)

  output$authorized_content <- renderUI({
    if (!is.null(users$user()) {
      ... # application content

shinyApp(ui, server)

This is a simple demo with users defined in a list. In a real-world scenario, you would store user credentials in a database or authenticate users with an external API. This is also covered in shiny.users.

In bigger apps with more users, you will also need user management, authorization management (different roles e.g. admin, writer, reader, etc) and usage statistics. For such advanced use cases, we created shiny.admin package.

Shiny.admin – user management and usage statistics

This package is an extension to the shiny.users package. When you add it to your Shiny app, you instantly get admin panel under the url http://application-url/#!/admin. This panel is only accessible by the users with “admin” role.

Features of shiny.admin:

  • Adding and removing users
  • Managing existing users – their passwords, roles and metadata
  • Statistics – counting unique users and sessions (similar to Google Analytics)
  • Session recording – recording defined actions e.g. provided input values and clicked elements. You can view all sessions details (similar to Hotjar)

We observed huge gains from above features. We exactly understood how our apps were used by our users. Here are some screenshots from shiny.admin:

I hope you like the idea of shiny.users and shiny.admin packages. Let us know what would you expect from user accounts and admin panel features. Do you think there is a need for developing such packages? Tell us about your use cases and needs in the comments or contact us at [email protected]

Reach out to Appsilon

Maria Grycuk
Maria Grycuk
Project Manager