Skip to contents

Get values from the user data environment of a Shiny session.

Usage

shiny_getenv(nms, unset = "", session = shiny::getDefaultReactiveDomain())

Arguments

nms

A character vector of names.

unset

The value to return for unset variables.

session

A Shiny session object. Defaults to the current session.

Value

A character vector of values.

Examples

session <- rlang::env(userData = rlang::env(foo = "bar", baz = "foo"))
shiny_getenv(c("foo", "baz"), session = session)
#> [1] "bar" "foo"
shiny_getenv("qux", unset = "unset", session = session)
#> [1] "unset"