Databricks Integrations with R

Problem

You are building an interactive R application which needs to act as the person visiting the application when accessing a private Databricks resource. The content must authenticate to Databricks using the viewer’s Databricks credentials. For example, reading data from a Databricks Unity Catalog table that has row-level permissions and each content viewer has a different level of data access.

Solution

The examples below illustrate how to use the OAuth integrations feature of Posit Connect to delegate authorization to the data provider. These examples use the viewer’s OAuth access token to call the Databricks API on behalf of the content viewer, allowing content to access private Databricks resources as the content viewer.

When publishing the content to Connect make sure the following environment variables are set for the deployed content:

  • DATABRICKS_HOST
  • DATABRICKS_PATH
renv.lock
{
  "R": {
    "Version": "4.3.0",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://cloud.r-project.org"
      }
    ]
  },
  "Packages": {
    "DBI": {
      "Package": "DBI",
      "Version": "1.2.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "065ae649b05f1ff66bb0c793107508f5"
    },
    "R6": {
      "Package": "R6",
      "Version": "2.5.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "470851b6d5d0ac559e9d01bb352b4021"
    },
    "Rcpp": {
      "Package": "Rcpp",
      "Version": "1.0.13",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "methods",
        "utils"
      ],
      "Hash": "f27411eb6d9c3dada5edd444b8416675"
    },
    "askpass": {
      "Package": "askpass",
      "Version": "1.2.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "sys"
      ],
      "Hash": "cad6cf7f1d5f6e906700b9d3e718c796"
    },
    "bit": {
      "Package": "bit",
      "Version": "4.0.5",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "d242abec29412ce988848d0294b208fd"
    },
    "bit64": {
      "Package": "bit64",
      "Version": "4.0.5",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "bit",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "9fe98599ca456d6552421db0d6772d8f"
    },
    "blob": {
      "Package": "blob",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "methods",
        "rlang",
        "vctrs"
      ],
      "Hash": "40415719b5a479b87949f3aa0aee737c"
    },
    "cli": {
      "Package": "cli",
      "Version": "3.6.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "b21916dd77a27642b447374a5d30ecf3"
    },
    "connectapi": {
      "Package": "connectapi",
      "Version": "0.3.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R6",
        "bit64",
        "fs",
        "glue",
        "httr",
        "jsonlite",
        "lifecycle",
        "magrittr",
        "purrr",
        "rlang",
        "tibble",
        "uuid",
        "vctrs"
      ],
      "Hash": "f5206247a25db881071783261b837afb"
    },
    "cpp11": {
      "Package": "cpp11",
      "Version": "0.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "91570bba75d0c9d3f1040c835cee8fba"
    },
    "crayon": {
      "Package": "crayon",
      "Version": "1.5.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "grDevices",
        "methods",
        "utils"
      ],
      "Hash": "859d96e65ef198fd43e82b9628d593ef"
    },
    "curl": {
      "Package": "curl",
      "Version": "5.2.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "8f27335f2bcff4d6035edcc82d7d46de"
    },
    "dbplyr": {
      "Package": "dbplyr",
      "Version": "2.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "DBI",
        "R",
        "R6",
        "blob",
        "cli",
        "dplyr",
        "glue",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "purrr",
        "rlang",
        "tibble",
        "tidyr",
        "tidyselect",
        "utils",
        "vctrs",
        "withr"
      ],
      "Hash": "39b2e002522bfd258039ee4e889e0fd1"
    },
    "dplyr": {
      "Package": "dplyr",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "generics",
        "glue",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "rlang",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "fedd9d00c2944ff00a0e2696ccf048ec"
    },
    "ellipsis": {
      "Package": "ellipsis",
      "Version": "0.3.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "rlang"
      ],
      "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077"
    },
    "fansi": {
      "Package": "fansi",
      "Version": "1.0.6",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "grDevices",
        "utils"
      ],
      "Hash": "962174cf2aeb5b9eea581522286a911f"
    },
    "fastmap": {
      "Package": "fastmap",
      "Version": "1.2.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
    },
    "fs": {
      "Package": "fs",
      "Version": "1.6.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a"
    },
    "generics": {
      "Package": "generics",
      "Version": "0.1.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "15e9634c0fcd294799e9b2e929ed1b86"
    },
    "glue": {
      "Package": "glue",
      "Version": "1.7.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "e0b3a53876554bd45879e596cdb10a52"
    },
    "hms": {
      "Package": "hms",
      "Version": "1.1.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "lifecycle",
        "methods",
        "pkgconfig",
        "rlang",
        "vctrs"
      ],
      "Hash": "b59377caa7ed00fa41808342002138f9"
    },
    "httpuv": {
      "Package": "httpuv",
      "Version": "1.6.15",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "R6",
        "Rcpp",
        "later",
        "promises",
        "utils"
      ],
      "Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0"
    },
    "httr": {
      "Package": "httr",
      "Version": "1.4.7",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "curl",
        "jsonlite",
        "mime",
        "openssl"
      ],
      "Hash": "ac107251d9d9fd72f0ca8049988f1d7f"
    },
    "httr2": {
      "Package": "httr2",
      "Version": "1.0.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "curl",
        "glue",
        "lifecycle",
        "magrittr",
        "openssl",
        "rappdirs",
        "rlang",
        "vctrs",
        "withr"
      ],
      "Hash": "10d93e97faad6b629301bb3a2fd23378"
    },
    "jsonlite": {
      "Package": "jsonlite",
      "Version": "1.8.8",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "methods"
      ],
      "Hash": "e1b9c55281c5adc4dd113652d9e26768"
    },
    "later": {
      "Package": "later",
      "Version": "1.3.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "Rcpp",
        "rlang"
      ],
      "Hash": "a3e051d405326b8b0012377434c62b37"
    },
    "lifecycle": {
      "Package": "lifecycle",
      "Version": "1.0.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "rlang"
      ],
      "Hash": "b8552d117e1b808b09a832f589b79035"
    },
    "magrittr": {
      "Package": "magrittr",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "7ce2733a9826b3aeb1775d56fd305472"
    },
    "mime": {
      "Package": "mime",
      "Version": "0.12",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "tools"
      ],
      "Hash": "18e9c28c1d3ca1560ce30658b22ce104"
    },
    "odbc": {
      "Package": "odbc",
      "Version": "1.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "DBI",
        "R",
        "Rcpp",
        "bit64",
        "blob",
        "cli",
        "hms",
        "lifecycle",
        "methods",
        "rlang"
      ],
      "Hash": "0609d24c52744c675f8578622c33d5fa"
    },
    "openssl": {
      "Package": "openssl",
      "Version": "2.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "askpass"
      ],
      "Hash": "c62edf62de70cadf40553e10c739049d"
    },
    "pillar": {
      "Package": "pillar",
      "Version": "1.9.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "cli",
        "fansi",
        "glue",
        "lifecycle",
        "rlang",
        "utf8",
        "utils",
        "vctrs"
      ],
      "Hash": "15da5a8412f317beeee6175fbc76f4bb"
    },
    "pkgconfig": {
      "Package": "pkgconfig",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "utils"
      ],
      "Hash": "01f28d4278f15c76cddbea05899c5d6f"
    },
    "plumber": {
      "Package": "plumber",
      "Version": "1.2.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "R6",
        "crayon",
        "ellipsis",
        "httpuv",
        "jsonlite",
        "lifecycle",
        "magrittr",
        "mime",
        "promises",
        "rlang",
        "sodium",
        "stringi",
        "swagger",
        "webutils"
      ],
      "Hash": "0c671ac357592beb716f19b818b72e50"
    },
    "promises": {
      "Package": "promises",
      "Version": "1.3.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R6",
        "Rcpp",
        "fastmap",
        "later",
        "magrittr",
        "rlang",
        "stats"
      ],
      "Hash": "434cd5388a3979e74be5c219bcd6e77d"
    },
    "purrr": {
      "Package": "purrr",
      "Version": "1.0.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "lifecycle",
        "magrittr",
        "rlang",
        "vctrs"
      ],
      "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc"
    },
    "rappdirs": {
      "Package": "rappdirs",
      "Version": "0.3.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "5e3c5dc0b071b21fa128676560dbe94d"
    },
    "renv": {
      "Package": "renv",
      "Version": "1.0.7",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "utils"
      ],
      "Hash": "397b7b2a265bc5a7a06852524dabae20"
    },
    "rlang": {
      "Package": "rlang",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
    },
    "sodium": {
      "Package": "sodium",
      "Version": "1.3.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Hash": "dd86d6fd2a01d4eb3777dfdee7076d56"
    },
    "stringi": {
      "Package": "stringi",
      "Version": "1.8.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "stats",
        "tools",
        "utils"
      ],
      "Hash": "39e1144fd75428983dc3f63aa53dfa91"
    },
    "stringr": {
      "Package": "stringr",
      "Version": "1.5.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "magrittr",
        "rlang",
        "stringi",
        "vctrs"
      ],
      "Hash": "960e2ae9e09656611e0b8214ad543207"
    },
    "swagger": {
      "Package": "swagger",
      "Version": "5.17.14.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "cd09053b2f1e87c0fa6c1c470e54ebb8"
    },
    "sys": {
      "Package": "sys",
      "Version": "3.4.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Hash": "3a1be13d68d47a8cd0bfd74739ca1555"
    },
    "tibble": {
      "Package": "tibble",
      "Version": "3.2.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "fansi",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "pkgconfig",
        "rlang",
        "utils",
        "vctrs"
      ],
      "Hash": "a84e2cc86d07289b3b6f5069df7a004c"
    },
    "tidyr": {
      "Package": "tidyr",
      "Version": "1.3.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "cpp11",
        "dplyr",
        "glue",
        "lifecycle",
        "magrittr",
        "purrr",
        "rlang",
        "stringr",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "915fb7ce036c22a6a33b5a8adb712eb1"
    },
    "tidyselect": {
      "Package": "tidyselect",
      "Version": "1.2.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang",
        "vctrs",
        "withr"
      ],
      "Hash": "829f27b9c4919c16b593794a6344d6c0"
    },
    "utf8": {
      "Package": "utf8",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "62b65c52671e6665f803ff02954446e9"
    },
    "uuid": {
      "Package": "uuid",
      "Version": "1.2-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "34e965e62a41fcafb1ca60e9b142085b"
    },
    "vctrs": {
      "Package": "vctrs",
      "Version": "0.6.5",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang"
      ],
      "Hash": "c03fa420630029418f7e6da3667aac4a"
    },
    "webutils": {
      "Package": "webutils",
      "Version": "1.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "curl",
        "jsonlite"
      ],
      "Hash": "498fc2f392a45fe30526f69b73cdeeb7"
    },
    "withr": {
      "Package": "withr",
      "Version": "3.0.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics"
      ],
      "Hash": "07909200e8bbe90426fbfeb73e1e27aa"
    }
  }
}
app.R
library(connectapi)
library(dbplyr)
library(dplyr)
library(httr2)
library(odbc)
library(plumber)

#* Return the Databricks username
#* @get /whoami
function(){
  databricks_user(session)$displayName
}

#* Return data from Databricks
#* @get /data
function(){
  con <- dbConnect(
    odbc::databricks(),
    httpPath = Sys.getenv("DATABRICKS_PATH"),
    authMech = 11,
    auth_flow = 0,
    auth_accesstoken = databricks_token(session)
  )
  data <- tbl(
    con,
    in_catalog("samples", "nyctaxi", "trips")
  ) |>
    head(10) |>
    collect()

  data
}

# call the databricks "current user" API to get
# information about the authenticated user.
databricks_user <- function(session) {
  host <- Sys.getenv("DATABRICKS_HOST")
  token <- databricks_token(session)

  url <- file.path(
    paste0("https://", host),
    "api/2.0/preview/scim/v2/Me",
    fsep = "/"
  )
  resp <- httr2::request(url) |>
    httr2::req_auth_bearer_token(token) |>
    httr2::req_retry(max_tries = 1) |>
    httr2::req_perform()

  resp_body <- httr2::resp_body_json(resp)
  resp_body
}

# obtain a databricks OAuth token.
# 1. if running on Posit Connect, exhanges Connect's user-session-token for the viewer's Databricks OAuth access token
# 2. if running on Posit Workbench, read the Databricks token from the workbench managed DATABRICKS_CONFIG_FILE
# 3. if running locally, read the Databricks token from the DATABRICKS_TOKEN environment var
databricks_token <- function(session) {
  host <- Sys.getenv("DATABRICKS_HOST")
  token <- NULL

  # if running on Connect
  if (Sys.getenv("RSTUDIO_PRODUCT") == "CONNECT") {
    # init Posit Connect API client
    client <- connect()
    # read the user-session-token header
    user_session_token <- session$request$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN
    # exchange session token for viewer OAuth access token
    credentials <- get_oauth_credentials(client, user_session_token)
    token <- credentials$access_token

  # not running on Connect, so check for a .databrickscfg file (automatically set by workbench)
  } else if (Sys.getenv("DATABRICKS_CONFIG_FILE") != "") {
    getDatabricksToken <- get(".rs.api.getDatabricksToken")
    token <- getDatabricksToken(host)

  # finally, look for a databricks token (must be set by the user when running locally)
  } else {
    token <- Sys.getenv("DATABRICKS_TOKEN")
  }

  token
}

Running the app locally

Terminal
export DATABRICKS_HOST="<databricks-sql-warehouse-server-hostname>"
export DATABRICKS_PATH="<databricks-sql-warehouse-http-path>"
# TOKEN is only required when running the example locally
DATABRICKS_TOKEN="<databricks-token>" R -e 'plumber::pr_run(pr=plumber::pr("app.R"))'
renv.lock
{
  "R": {
    "Version": "4.3.0",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://cloud.r-project.org"
      }
    ]
  },
  "Packages": {
    "DBI": {
      "Package": "DBI",
      "Version": "1.2.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "065ae649b05f1ff66bb0c793107508f5"
    },
    "R6": {
      "Package": "R6",
      "Version": "2.5.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "470851b6d5d0ac559e9d01bb352b4021"
    },
    "RColorBrewer": {
      "Package": "RColorBrewer",
      "Version": "1.1-3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "45f0398006e83a5b10b72a90663d8d8c"
    },
    "Rcpp": {
      "Package": "Rcpp",
      "Version": "1.0.13",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "methods",
        "utils"
      ],
      "Hash": "f27411eb6d9c3dada5edd444b8416675"
    },
    "V8": {
      "Package": "V8",
      "Version": "5.0.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "Rcpp",
        "curl",
        "jsonlite",
        "utils"
      ],
      "Hash": "9eb7b2df315593e726b029200fc0276c"
    },
    "askpass": {
      "Package": "askpass",
      "Version": "1.2.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "sys"
      ],
      "Hash": "cad6cf7f1d5f6e906700b9d3e718c796"
    },
    "base64enc": {
      "Package": "base64enc",
      "Version": "0.1-3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "543776ae6848fde2f48ff3816d0628bc"
    },
    "bigD": {
      "Package": "bigD",
      "Version": "0.2.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "93637e906f3fe962413912c956eb44db"
    },
    "bit": {
      "Package": "bit",
      "Version": "4.0.5",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "d242abec29412ce988848d0294b208fd"
    },
    "bit64": {
      "Package": "bit64",
      "Version": "4.0.5",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "bit",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "9fe98599ca456d6552421db0d6772d8f"
    },
    "bitops": {
      "Package": "bitops",
      "Version": "1.0-8",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "da69e6b6f8feebec0827205aad3fdbd8"
    },
    "blob": {
      "Package": "blob",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "methods",
        "rlang",
        "vctrs"
      ],
      "Hash": "40415719b5a479b87949f3aa0aee737c"
    },
    "bslib": {
      "Package": "bslib",
      "Version": "0.7.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "base64enc",
        "cachem",
        "fastmap",
        "grDevices",
        "htmltools",
        "jquerylib",
        "jsonlite",
        "lifecycle",
        "memoise",
        "mime",
        "rlang",
        "sass"
      ],
      "Hash": "8644cc53f43828f19133548195d7e59e"
    },
    "cachem": {
      "Package": "cachem",
      "Version": "1.1.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "fastmap",
        "rlang"
      ],
      "Hash": "cd9a672193789068eb5a2aad65a0dedf"
    },
    "cli": {
      "Package": "cli",
      "Version": "3.6.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52"
    },
    "colorspace": {
      "Package": "colorspace",
      "Version": "2.1-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "methods",
        "stats"
      ],
      "Hash": "d954cb1c57e8d8b756165d7ba18aa55a"
    },
    "commonmark": {
      "Package": "commonmark",
      "Version": "1.9.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Hash": "5d8225445acb167abf7797de48b2ee3c"
    },
    "connectapi": {
      "Package": "connectapi",
      "Version": "0.3.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R6",
        "bit64",
        "fs",
        "glue",
        "httr",
        "jsonlite",
        "lifecycle",
        "magrittr",
        "purrr",
        "rlang",
        "tibble",
        "uuid",
        "vctrs"
      ],
      "Hash": "f5206247a25db881071783261b837afb"
    },
    "cpp11": {
      "Package": "cpp11",
      "Version": "0.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "91570bba75d0c9d3f1040c835cee8fba"
    },
    "crayon": {
      "Package": "crayon",
      "Version": "1.5.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "grDevices",
        "methods",
        "utils"
      ],
      "Hash": "859d96e65ef198fd43e82b9628d593ef"
    },
    "curl": {
      "Package": "curl",
      "Version": "5.2.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "411ca2c03b1ce5f548345d2fc2685f7a"
    },
    "dbplyr": {
      "Package": "dbplyr",
      "Version": "2.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "DBI",
        "R",
        "R6",
        "blob",
        "cli",
        "dplyr",
        "glue",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "purrr",
        "rlang",
        "tibble",
        "tidyr",
        "tidyselect",
        "utils",
        "vctrs",
        "withr"
      ],
      "Hash": "39b2e002522bfd258039ee4e889e0fd1"
    },
    "digest": {
      "Package": "digest",
      "Version": "0.6.35",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31"
    },
    "dplyr": {
      "Package": "dplyr",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "generics",
        "glue",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "rlang",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "fedd9d00c2944ff00a0e2696ccf048ec"
    },
    "evaluate": {
      "Package": "evaluate",
      "Version": "0.24.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "a1066cbc05caee9a4bf6d90f194ff4da"
    },
    "fansi": {
      "Package": "fansi",
      "Version": "1.0.6",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "grDevices",
        "utils"
      ],
      "Hash": "962174cf2aeb5b9eea581522286a911f"
    },
    "farver": {
      "Package": "farver",
      "Version": "2.1.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "680887028577f3fa2a81e410ed0d6e42"
    },
    "fastmap": {
      "Package": "fastmap",
      "Version": "1.2.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
    },
    "fontawesome": {
      "Package": "fontawesome",
      "Version": "0.5.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "htmltools",
        "rlang"
      ],
      "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d"
    },
    "fs": {
      "Package": "fs",
      "Version": "1.6.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "47b5f30c720c23999b913a1a635cf0bb"
    },
    "generics": {
      "Package": "generics",
      "Version": "0.1.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "15e9634c0fcd294799e9b2e929ed1b86"
    },
    "glue": {
      "Package": "glue",
      "Version": "1.7.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "e0b3a53876554bd45879e596cdb10a52"
    },
    "gt": {
      "Package": "gt",
      "Version": "0.11.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "base64enc",
        "bigD",
        "bitops",
        "cli",
        "commonmark",
        "dplyr",
        "fs",
        "glue",
        "htmltools",
        "htmlwidgets",
        "juicyjuice",
        "magrittr",
        "markdown",
        "reactable",
        "rlang",
        "sass",
        "scales",
        "tidyselect",
        "vctrs",
        "xml2"
      ],
      "Hash": "3470c2eb1123db6a2c54ec812de38284"
    },
    "highr": {
      "Package": "highr",
      "Version": "0.11",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "xfun"
      ],
      "Hash": "d65ba49117ca223614f71b60d85b8ab7"
    },
    "hms": {
      "Package": "hms",
      "Version": "1.1.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "lifecycle",
        "methods",
        "pkgconfig",
        "rlang",
        "vctrs"
      ],
      "Hash": "b59377caa7ed00fa41808342002138f9"
    },
    "htmltools": {
      "Package": "htmltools",
      "Version": "0.5.8.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "base64enc",
        "digest",
        "fastmap",
        "grDevices",
        "rlang",
        "utils"
      ],
      "Hash": "81d371a9cc60640e74e4ab6ac46dcedc"
    },
    "htmlwidgets": {
      "Package": "htmlwidgets",
      "Version": "1.6.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "grDevices",
        "htmltools",
        "jsonlite",
        "knitr",
        "rmarkdown",
        "yaml"
      ],
      "Hash": "04291cc45198225444a397606810ac37"
    },
    "httpuv": {
      "Package": "httpuv",
      "Version": "1.6.15",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "R6",
        "Rcpp",
        "later",
        "promises",
        "utils"
      ],
      "Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0"
    },
    "httr": {
      "Package": "httr",
      "Version": "1.4.7",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "curl",
        "jsonlite",
        "mime",
        "openssl"
      ],
      "Hash": "ac107251d9d9fd72f0ca8049988f1d7f"
    },
    "httr2": {
      "Package": "httr2",
      "Version": "1.0.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "curl",
        "glue",
        "lifecycle",
        "magrittr",
        "openssl",
        "rappdirs",
        "rlang",
        "vctrs",
        "withr"
      ],
      "Hash": "320c8fe23fcb25a6690ef7bdb6a3a705"
    },
    "jquerylib": {
      "Package": "jquerylib",
      "Version": "0.1.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "htmltools"
      ],
      "Hash": "5aab57a3bd297eee1c1d862735972182"
    },
    "jsonlite": {
      "Package": "jsonlite",
      "Version": "1.8.8",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "methods"
      ],
      "Hash": "e1b9c55281c5adc4dd113652d9e26768"
    },
    "juicyjuice": {
      "Package": "juicyjuice",
      "Version": "0.1.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "V8"
      ],
      "Hash": "3bcd11943da509341838da9399e18bce"
    },
    "knitr": {
      "Package": "knitr",
      "Version": "1.48",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "evaluate",
        "highr",
        "methods",
        "tools",
        "xfun",
        "yaml"
      ],
      "Hash": "acf380f300c721da9fde7df115a5f86f"
    },
    "labeling": {
      "Package": "labeling",
      "Version": "0.4.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "graphics",
        "stats"
      ],
      "Hash": "b64ec208ac5bc1852b285f665d6368b3"
    },
    "later": {
      "Package": "later",
      "Version": "1.3.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "Rcpp",
        "rlang"
      ],
      "Hash": "a3e051d405326b8b0012377434c62b37"
    },
    "lifecycle": {
      "Package": "lifecycle",
      "Version": "1.0.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "rlang"
      ],
      "Hash": "b8552d117e1b808b09a832f589b79035"
    },
    "magrittr": {
      "Package": "magrittr",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "7ce2733a9826b3aeb1775d56fd305472"
    },
    "markdown": {
      "Package": "markdown",
      "Version": "1.13",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "commonmark",
        "utils",
        "xfun"
      ],
      "Hash": "074efab766a9d6360865ad39512f2a7e"
    },
    "memoise": {
      "Package": "memoise",
      "Version": "2.0.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "cachem",
        "rlang"
      ],
      "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c"
    },
    "mime": {
      "Package": "mime",
      "Version": "0.12",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "tools"
      ],
      "Hash": "18e9c28c1d3ca1560ce30658b22ce104"
    },
    "munsell": {
      "Package": "munsell",
      "Version": "0.5.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "colorspace",
        "methods"
      ],
      "Hash": "4fd8900853b746af55b81fda99da7695"
    },
    "odbc": {
      "Package": "odbc",
      "Version": "1.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "DBI",
        "R",
        "Rcpp",
        "bit64",
        "blob",
        "cli",
        "hms",
        "lifecycle",
        "methods",
        "rlang"
      ],
      "Hash": "0609d24c52744c675f8578622c33d5fa"
    },
    "openssl": {
      "Package": "openssl",
      "Version": "2.1.2",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "askpass"
      ],
      "Hash": "ea2475b073243d9d338aa8f086ce973e"
    },
    "pillar": {
      "Package": "pillar",
      "Version": "1.9.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "cli",
        "fansi",
        "glue",
        "lifecycle",
        "rlang",
        "utf8",
        "utils",
        "vctrs"
      ],
      "Hash": "15da5a8412f317beeee6175fbc76f4bb"
    },
    "pkgconfig": {
      "Package": "pkgconfig",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "utils"
      ],
      "Hash": "01f28d4278f15c76cddbea05899c5d6f"
    },
    "promises": {
      "Package": "promises",
      "Version": "1.3.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R6",
        "Rcpp",
        "fastmap",
        "later",
        "magrittr",
        "rlang",
        "stats"
      ],
      "Hash": "434cd5388a3979e74be5c219bcd6e77d"
    },
    "purrr": {
      "Package": "purrr",
      "Version": "1.0.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "lifecycle",
        "magrittr",
        "rlang",
        "vctrs"
      ],
      "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc"
    },
    "rappdirs": {
      "Package": "rappdirs",
      "Version": "0.3.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "5e3c5dc0b071b21fa128676560dbe94d"
    },
    "reactR": {
      "Package": "reactR",
      "Version": "0.6.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "htmltools"
      ],
      "Hash": "10f4d661c235181648a5958c02c0382a"
    },
    "reactable": {
      "Package": "reactable",
      "Version": "0.4.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "digest",
        "htmltools",
        "htmlwidgets",
        "jsonlite",
        "reactR"
      ],
      "Hash": "6069eb2a6597963eae0605c1875ff14c"
    },
    "renv": {
      "Package": "renv",
      "Version": "1.0.7",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "utils"
      ],
      "Hash": "397b7b2a265bc5a7a06852524dabae20"
    },
    "rlang": {
      "Package": "rlang",
      "Version": "1.1.3",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
    },
    "rmarkdown": {
      "Package": "rmarkdown",
      "Version": "2.28",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "bslib",
        "evaluate",
        "fontawesome",
        "htmltools",
        "jquerylib",
        "jsonlite",
        "knitr",
        "methods",
        "tinytex",
        "tools",
        "utils",
        "xfun",
        "yaml"
      ],
      "Hash": "062470668513dcda416927085ee9bdc7"
    },
    "sass": {
      "Package": "sass",
      "Version": "0.4.9",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R6",
        "fs",
        "htmltools",
        "rappdirs",
        "rlang"
      ],
      "Hash": "d53dbfddf695303ea4ad66f86e99b95d"
    },
    "scales": {
      "Package": "scales",
      "Version": "1.3.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "RColorBrewer",
        "cli",
        "farver",
        "glue",
        "labeling",
        "lifecycle",
        "munsell",
        "rlang",
        "viridisLite"
      ],
      "Hash": "c19df082ba346b0ffa6f833e92de34d1"
    },
    "shiny": {
      "Package": "shiny",
      "Version": "1.9.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "bslib",
        "cachem",
        "commonmark",
        "crayon",
        "fastmap",
        "fontawesome",
        "glue",
        "grDevices",
        "htmltools",
        "httpuv",
        "jsonlite",
        "later",
        "lifecycle",
        "methods",
        "mime",
        "promises",
        "rlang",
        "sourcetools",
        "tools",
        "utils",
        "withr",
        "xtable"
      ],
      "Hash": "01666113b04d504390d60736f39bd0d0"
    },
    "sourcetools": {
      "Package": "sourcetools",
      "Version": "0.1.7-1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "5f5a7629f956619d519205ec475fe647"
    },
    "stringi": {
      "Package": "stringi",
      "Version": "1.8.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "stats",
        "tools",
        "utils"
      ],
      "Hash": "39e1144fd75428983dc3f63aa53dfa91"
    },
    "stringr": {
      "Package": "stringr",
      "Version": "1.5.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "magrittr",
        "rlang",
        "stringi",
        "vctrs"
      ],
      "Hash": "960e2ae9e09656611e0b8214ad543207"
    },
    "sys": {
      "Package": "sys",
      "Version": "3.4.2",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Hash": "3a1be13d68d47a8cd0bfd74739ca1555"
    },
    "tibble": {
      "Package": "tibble",
      "Version": "3.2.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "fansi",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "pkgconfig",
        "rlang",
        "utils",
        "vctrs"
      ],
      "Hash": "a84e2cc86d07289b3b6f5069df7a004c"
    },
    "tidyr": {
      "Package": "tidyr",
      "Version": "1.3.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "cpp11",
        "dplyr",
        "glue",
        "lifecycle",
        "magrittr",
        "purrr",
        "rlang",
        "stringr",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "915fb7ce036c22a6a33b5a8adb712eb1"
    },
    "tidyselect": {
      "Package": "tidyselect",
      "Version": "1.2.1",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang",
        "vctrs",
        "withr"
      ],
      "Hash": "829f27b9c4919c16b593794a6344d6c0"
    },
    "tinytex": {
      "Package": "tinytex",
      "Version": "0.52",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "xfun"
      ],
      "Hash": "cfbad971a71f0e27cec22e544a08bc3b"
    },
    "utf8": {
      "Package": "utf8",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R"
      ],
      "Hash": "62b65c52671e6665f803ff02954446e9"
    },
    "uuid": {
      "Package": "uuid",
      "Version": "1.2-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "34e965e62a41fcafb1ca60e9b142085b"
    },
    "vctrs": {
      "Package": "vctrs",
      "Version": "0.6.5",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang"
      ],
      "Hash": "c03fa420630029418f7e6da3667aac4a"
    },
    "viridisLite": {
      "Package": "viridisLite",
      "Version": "0.4.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "c826c7c4241b6fc89ff55aaea3fa7491"
    },
    "withr": {
      "Package": "withr",
      "Version": "3.0.0",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "grDevices",
        "graphics"
      ],
      "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35"
    },
    "xfun": {
      "Package": "xfun",
      "Version": "0.47",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "stats",
        "tools"
      ],
      "Hash": "36ab21660e2d095fef0d83f689e0477c"
    },
    "xml2": {
      "Package": "xml2",
      "Version": "1.3.6",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "methods",
        "rlang"
      ],
      "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61"
    },
    "xtable": {
      "Package": "xtable",
      "Version": "1.8-4",
      "Source": "Repository",
      "Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest",
      "Requirements": [
        "R",
        "stats",
        "utils"
      ],
      "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2"
    },
    "yaml": {
      "Package": "yaml",
      "Version": "2.3.10",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "51dab85c6c98e50a18d7551e9d49f76c"
    }
  }
}
app.R
library(connectapi)
library(dbplyr)
library(dplyr)
library(gt)
library(httr2)
library(odbc)
library(shiny)

ui <- fluidPage(
    mainPanel(
        textOutput("display_name"),
        gt_output("data")
    ))

server <- function(input, output, session) {

  user <- reactive({
    databricks_user(session)
  })

  output$display_name <- renderText({
    paste0("Hello, ", user()$displayName, "!")
  })

  con <- dbConnect(
    odbc::databricks(),
    httpPath = Sys.getenv("DATABRICKS_PATH"),
    authMech = 11,
    auth_flow = 0,
    auth_accesstoken = databricks_token(session)
  )

  output$data <- render_gt({
    data <- tbl(
      con,
      in_catalog("samples", "nyctaxi", "trips")
    ) |>
      head(10) |>
      collect()
    validate(need(nrow(data) > 0, "No data available"))

    data |>
    gt()
  })
}

# call the databricks "current user" API to get
# information about the authenticated user.
databricks_user <- function(session) {
  host <- Sys.getenv("DATABRICKS_HOST")
  token <- databricks_token(session)

  url <- file.path(
    paste0("https://", host),
    "api/2.0/preview/scim/v2/Me",
    fsep = "/"
  )
  resp <- httr2::request(url) |>
    httr2::req_auth_bearer_token(token) |>
    httr2::req_retry(max_tries = 1) |>
    httr2::req_perform()

  validate(need(!resp_status(resp) == 403L, "Not authorized."))
  validate(need(!resp_is_error(resp), resp))

  resp_body <- httr2::resp_body_json(resp)
  resp_body
}

# obtain a databricks OAuth token.
# 1. if running on Posit Connect, exhanges Connect's user-session-token for the viewer's Databricks OAuth access token
# 2. if running on Posit Workbench, read the Databricks token from the workbench managed DATABRICKS_CONFIG_FILE
# 3. if running locally, read the Databricks token from the DATABRICKS_TOKEN environment var
databricks_token <- function(session) {
  host <- Sys.getenv("DATABRICKS_HOST")
  token <- NULL

  # if running on Connect
  if (Sys.getenv("RSTUDIO_PRODUCT") == "CONNECT") {
    # init Posit Connect API client
    client <- connect()
    # read the user-session-token header
    user_session_token <- session$request$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN
    # exchange session token for viewer OAuth access token
    credentials <- get_oauth_credentials(client, user_session_token)
    token <- credentials$access_token

  # not running on Connect, so check for a .databrickscfg file (automatically set by workbench)
  } else if (Sys.getenv("DATABRICKS_CONFIG_FILE") != "") {
    getDatabricksToken <- get(".rs.api.getDatabricksToken")
    token <- getDatabricksToken(host)

  # finally, look for a databricks token (must be set by the user when running locally)
  } else {
    token <- Sys.getenv("DATABRICKS_TOKEN")
  }

  token
}

# start the Shiny app
shinyApp(ui = ui, server = server)

Running the app locally

Terminal
export DATABRICKS_HOST="<databricks-sql-warehouse-server-hostname>"
export DATABRICKS_PATH="<databricks-sql-warehouse-http-path>"
# TOKEN is only required when running the example locally
DATABRICKS_TOKEN="<databricks-token>" R -e "shiny::runApp()"