knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) source("man/figures/hexsticker.R")
The appId
is a package to get authentication with App ID IBM service in the Shiny Apps.
remotes::install_github("th1460/appId")
In the first, you need generate a config yaml file with:
gen_appid_config(name = "Myapp")
And resulting
# appid_config.yml name: Myapp config: key: !expr Sys.getenv("APPID_KEY") secret: !expr Sys.getenv("APPID_SECRET") redirect_uri: !expr Sys.getenv("APP_URL") base_url: !expr Sys.getenv("APPID_URL") authorize: authorization access: token scope: openid password: !expr Sys.getenv("SECRET") # encrypt token
You should too, create a .Renviron
file with the credentials.
require(shiny) require(shinydashboard) require(appId) ui <- dashboardPage( dashboardHeader(user_info(), # show user info title = "My dashboard"), dashboardSidebar(), dashboardBody() ) server <- function(input, output, session) { # if you want get user info in app userinfo <- callModule(get_user_info, "userinfo") output$user <- renderText({userinfo()}) } # modified shinyApp shinyAppId(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.