The peeky package (GitHub, documentation) lets you download and extract the source code behind published Shinylive applications — the browser-based Shiny apps that run entirely on WebAssembly builds of R (webR) and Python (Pyodide) with no computational server in sight. It works with both standalone Shinylive apps and Quarto documents that embed them, in both R and Python flavors.
There’s a fact about Shinylive that’s easy to forget the first time you watch one of these apps spin up in a browser tab: there are no secrets. To run a Shiny app client-side, the conversion process bundles up everything the app needs — the source code, the data files, the supporting assets — and ships all of it to the visitor’s browser. That isn’t a leak; it’s the whole design. The app is the bundle. peeky simply follows that idea to its logical conclusion: point it at a deployed Shinylive app and it reconstructs a runnable copy of the original project on your machine.
I built peeky as a teaching tool. It grew out of conversations in STATS 290 about Shiny security, transparency, and where computation ought to live. It’s one thing to tell students that a browser-based app hands over its source; it is another to give them a one-liner that downloads that source and prints the commands to run it. Consider the package a friendly, tangible reminder for anyone shipping Shinylive: design with the understanding that your users can read everything you send them.
Taking a peek
The headline function, peek_shinylive_app(), inspects a URL, works out whether it points to a standalone app or a Quarto document, and extracts accordingly:
library(peeky)
# Point at any deployed Shinylive app and say where to put the files
peek_shinylive_app(
"https://quarto-ext.github.io/shinylive/",
output_dir = "shinylive-apps"
)It reconstructs the project in the directory you choose and prints the exact commands to launch each extracted app. If you already know what you’re looking at, two focused functions do the same job:
# A standalone Shinylive application (an app.json bundle)
peek_standalone_shinylive_app(
"https://tutorials.thecoatlessprofessor.com/convert-shiny-app-r-shinylive/",
output_dir = "standalone-app"
)
# A Quarto document with one or more embedded apps
peek_quarto_shinylive_app(
"https://quarto-ext.github.io/shinylive/",
output_format = "app-dir", # or "quarto" to rebuild a single .qmd
output_path = "quarto-apps"
)By design you always tell peeky where to write — there is no default output location, so it never drops files somewhere you didn’t ask for. For a longer tour of how a Shiny app becomes a Shinylive app and how peeky takes it back apart, see the Behind the Scenes article in the package documentation.
Installation
peeky is available now from GitHub, with a CRAN submission on the way:
# install.packages("remotes")
remotes::install_github("coatless-rpkg/peeky")For details, see the peeky news file entry below:
peeky news file entry for version 0.1.0
Features
peekylets you peek at the source code of a Shinylive application. It works with both standalone and embedded Shinylive applications written in either R or Python.- The package provides three primary functions:
peek_shinylive_app(): the general-purpose entry point that handles both standalone apps and Quarto documents.peek_standalone_shinylive_app(): for standalone Shinylive applications.peek_quarto_shinylive_app(): for Quarto documents with embedded Shinylive applications.