Save and Restore the State of 'shiny' Applications
Overview
Save the state of applications built with 'shiny', the web application framework by Chang et al. (2026) doi:10.32614/CRAN.package.shiny. Users can share their work and continue it in another session. Input values and selected values held by the server are saved in JSON (JavaScript Object Notation) files that can be read and edited by hand. Saved state can be restored without reloading the page or setting up bookmarking. Restoration waits for inputs that appear as the page changes and reports which values were restored, missing, or could not be applied.
Initial release.
Snapshots
snap_take()captures the inputs that are on the page (as reported by the client script, so values of removed dynamic UI are dropped), thereactiveValuesregistered withsnap_track(), and the values written bysnap_on_save()hooks. Action buttons, passwords, values that shiny's serializers mark as unserializable, ids excluded withsetBookmarkExclude(), and the patterns given tosnap_enable(),snap_exclude(), andsnap_include()are left out.- The snapshot object is a plain list of class
shinysnap, withsnap_inputs(),snap_values(),snap_meta(), andsnap_diff().
Files
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
- The canonical format is JSON: doubles written with the fewest digits that round-trip, typed wrappers for what JSON cannot say, deterministic layout.
snap_serialize(),snap_unserialize(),snap_write(), andsnap_read()convert;snap_write(format = "zip")writes a bundle that keeps uploaded files and, withunsupported = "rds", opaque R objects. Bundles are validated before extraction; embedded objects and.rdsfiles needtrust = TRUE. snap_download_button(),snap_download_handler(),snap_file_input(), andsnap_file_restore()replace the download and upload boilerplate.
Restore
snap_restore()restores a snapshot into the running session: tracked values are written back,snap_on_restore()hooks run, and the input values are sent to the browser at once, where the client script applies each one as soon as its input is on the page. shiny'srestoreInput()mechanism is primed during the restore so dynamic UI is built with the restored values. A second restore cancels the first.- The restore report lists every input as
applied,constructed,reapplied,missing,failed,mismatched, orskipped;snap_on_restored()hooks andsnap_is_restoring()complete the server-side API. snap_restorer()registers how an input's value becomes the message its binding understands, per binding name or per input id; built-in restorers cover shiny, bslib, and shinyMatrix inputs, andwindow.shinysnap.registerAdapter()is the JavaScript-side equivalent.
Interoperability
snap_as_bookmark_url()encodes a snapshot like URL bookmarking does,snap_as_test_inputs()feedsshiny::testServer(), andsnap_attachment()returns the files kept in a bundle.
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK2 OK2026-09-28
Documentation
- Help pages
- 19 (1 internal)includes a package overview page
- Examples that run
- 100%18 run in a plain check (10 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 83%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 10
- Median days to close, 50 most recently updated closed PRs
- 0
PRs over time
6 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/nanxstats/shinysnap on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow
pkgdown site last built 2026-09-29
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-09-17Pull request it wrote: opened by a project memberCommits: at least 6 crediting it in the message
- Claude Fable 5.15 commits · Sep 2026
- Claude Opus 4.81 commit · Sep 2026
Dependencies
Code & Tests
People & History
- 0.1.0Latest2026-09-28 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-09-28
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 241 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("shinysnap")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.