Authentication
Get Started
Custom Branding
Social Sign In
Hosting
Get Started
Custom Domains
Database Connections
Rmarkdown
API


Get Started


Welcome to the Polished.tech documentation!

Follow this documentation to configure Polished Authentication with your Shiny apps in minutes!



  1. If you don't already have a polished.tech account, sign up for polished.techhere.
  2. In your polished.tech dashboard, go to the "Shiny Apps" page. Click the "Add Shiny App" button:

  3. Enter the name of your Shiny app and click the "+ Add Shiny App" button.



    You can name your app any combination of lowercase letters, numbers, "_", and "-". In the above screenshot, I named my Shiny app "my_first_shiny_app".
  4. Go to the the "Account" page and copy your secret API key. You will need to click the "Show Secret" button to reveal your secret API key:

  5. Back in R, install polished from CRAN.

    install.packages("polished")

  6. Configure your Shiny app to use polished.

    Below is a simple polished Shiny app. If you replace "<your polished.tech secret API key>" with your polished.tech secret API key from step 4, you should be able to copy and paste the below code into a folder containing "global.R", "ui.R", and "server.R" files and run a polished Shiny app.

    You can access the signed in user's information using the session$userData$user() reactive. See the server function below for an example.

    # global.R 
    
    library(shiny)
    library(polished)
    
    # configure the global sessions when the app initially starts up.
    polished::global_sessions_config(
      app_name = "my_first_shiny_app",
      api_key = "<your polished.tech secret API key>"
    )

    # ui.R
    
    ui <- fluidPage(
      fluidRow(
        column(
          6,
          h1("Hello Shiny!")
        ),
        column(
          6,
          br(),
          actionButton(
            "sign_out",
            "Sign Out",
            icon = icon("sign-out-alt"),
            class = "pull-right"
          )
        ),
        column(
          12,
          verbatimTextOutput("user_out")
        )
      )
    )
    
    polished::secure_ui(ui)

    # server.R
    
    server <- function(input, output, session) {
      output$user_out <- renderPrint({
        session$userData$user()
      })
    
      observeEvent(input$sign_out, {
        sign_out_from_shiny()
        session$reload()
      })
    }
    
    polished::secure_server(server)

    That's it! You now have a secured Shiny app complete with sign in and registration pages, email verification, and password reset among other features. Use the polished.tech dashboard to grant your email address access to your Shiny app, and you can register and sign in.

    The above Shiny app should look like this:




    Next Steps


    Now that you have set up polished, let's go to the next page to customize your sign in and registration pages.






Get Started


Welcome to the Polished.tech documentation!

Follow this documentation to configure Polished Authentication with your Shiny apps in minutes!



  1. If you don't already have a polished.tech account, sign up for polished.techhere.
  2. In your polished.tech dashboard, go to the "Shiny Apps" page. Click the "Add Shiny App" button:

  3. Enter the name of your Shiny app and click the "+ Add Shiny App" button.



    You can name your app any combination of lowercase letters, numbers, "_", and "-". In the above screenshot, I named my Shiny app "my_first_shiny_app".
  4. Go to the the "Account" page and copy your secret API key. You will need to click the "Show Secret" button to reveal your secret API key:

  5. Back in R, install polished from CRAN.

    install.packages("polished")

  6. Configure your Shiny app to use polished.

    Below is a simple polished Shiny app. If you replace "<your polished.tech secret API key>" with your polished.tech secret API key from step 4, you should be able to copy and paste the below code into a folder containing "global.R", "ui.R", and "server.R" files and run a polished Shiny app.

    You can access the signed in user's information using the session$userData$user() reactive. See the server function below for an example.

    # global.R 
    
    library(shiny)
    library(polished)
    
    # configure the global sessions when the app initially starts up.
    polished::global_sessions_config(
      app_name = "my_first_shiny_app",
      api_key = "<your polished.tech secret API key>"
    )

    # ui.R
    
    ui <- fluidPage(
      fluidRow(
        column(
          6,
          h1("Hello Shiny!")
        ),
        column(
          6,
          br(),
          actionButton(
            "sign_out",
            "Sign Out",
            icon = icon("sign-out-alt"),
            class = "pull-right"
          )
        ),
        column(
          12,
          verbatimTextOutput("user_out")
        )
      )
    )
    
    polished::secure_ui(ui)

    # server.R
    
    server <- function(input, output, session) {
      output$user_out <- renderPrint({
        session$userData$user()
      })
    
      observeEvent(input$sign_out, {
        sign_out_from_shiny()
        session$reload()
      })
    }
    
    polished::secure_server(server)

    That's it! You now have a secured Shiny app complete with sign in and registration pages, email verification, and password reset among other features. Use the polished.tech dashboard to grant your email address access to your Shiny app, and you can register and sign in.

    The above Shiny app should look like this:




    Next Steps


    Now that you have set up polished, let's go to the next page to customize your sign in and registration pages.