Learn R Programming

polished (version 0.4.0)

global_sessions_config: Configuration for global sessions

Description

This is the primary function for configuring polished. It configures your app's instance of the Sessions class that manages your user's polished sessions. Call this function in your global.R file. See https://github.com/Tychobra/polished/blob/master/inst/examples/polished_example_01/global.R for a complete example.

Usage

global_sessions_config(
  app_name,
  api_key,
  firebase_config = NULL,
  admin_mode = FALSE,
  is_invite_required = TRUE,
  sign_in_providers = "email",
  is_email_verification_required = TRUE,
  is_auth_required = TRUE,
  sentry_dsn = NULL
)

Arguments

app_name

the name of the app.

api_key

the API key. Either from https://polished.tech or your on premise polished API deployment.

firebase_config

a list containing your Firebase project configuration. This list should have the following named elements:

  • apiKey

  • authDomain

  • projectId

admin_mode

FALSE by default. Set to TRUE to enter the polished Admin Panel without needing to register and sign in. This is useful during development for inviting the first users to your app. Make sure to set admin_mode = FALSE before deploying your app.

is_invite_required

TRUE by default. Whether or not to require the user to have an invite before registering/signing in

sign_in_providers

the sign in providers to enable. Valid values are "google" "email", "microsoft", and/or "facebook". Defaults to "email".

is_email_verification_required

TRUE by default. Whether or not to require the user to verify their email before accessing your Shiny app.

is_auth_required

TRUE by default. Whether or not to require users to be signed in to access the app. It can be useful to set this argument to FALSE if you want to allow user to do certain actions (such as viewing charts and tables) without signing in, and only require users to sign in if they want to save data to your database.

sentry_dsn

either NULL, the default, or your Sentry project DSN.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# global.R

global_sessions_config(
  app_name = "<your app name>",
  api_key = "<your API key>"
)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab