if (FALSE) {
# Make sure the PLUMBER_SECRET environment variable is valid before
# running these examples (NULL or a valid secret)
data_storage <- DataStoragePlumber$new(
hostname = "connect.appsilon.com",
path = "shiny_telemetry_plumber",
port = 443,
protocol = "https",
authorization = Sys.getenv("CONNECT_AUTHORIZATION_KEY"),
secret = Sys.getenv("PLUMBER_SECRET")
)
data_storage <- DataStoragePlumber$new(
hostname = "127.0.0.1",
path = NULL,
port = 8087,
protocol = "http",
secret = Sys.getenv("PLUMBER_SECRET")
)
data_storage$insert("example", "test_event", "session1")
data_storage$insert("example", "input", "s1", list(id = "id"))
data_storage$insert("example", "input", "s1", list(id = "id2", value = 32))
data_storage$insert(
"example", "test_event_3_days_ago", "session1",
time = lubridate::as_datetime(lubridate::today() - 3)
)
data_storage$read_event_data()
data_storage$read_event_data(Sys.Date() - 1, Sys.Date() + 1)
}
Run the code above in your browser using DataLab