| export | R Documentation |
Main entry point function that wraps the conversion, building, and optionally running of a Shiny application as an Electron desktop application.
export(
appdir,
destdir,
app_name = NULL,
app_type = NULL,
runtime_strategy = NULL,
sign = FALSE,
platform = NULL,
arch = NULL,
icon = NULL,
overwrite = FALSE,
build = TRUE,
run_after = FALSE,
open_after = FALSE,
verbose = TRUE
)
appdir |
Character string. Path to the directory containing the Shiny application. |
destdir |
Character string. Path to the destination directory where the Electron app will be created. |
app_name |
Character string. Display name of the application. If NULL,
uses |
app_type |
Character string or NULL. Language of the Shiny app:
|
runtime_strategy |
Character string or NULL. How R or Python reaches
the end user: |
sign |
Logical. Whether to enable code signing for the built application. When TRUE, electron-builder will attempt to sign the app using credentials from environment variables or the config file. Default is FALSE. |
platform |
Character vector. Target platforms: "win", "mac", "linux".
If NULL, uses |
arch |
Character vector. Target architectures: "x64", "arm64". If
NULL, uses |
icon |
Character string. Path to application icon file, absolute or
relative to the working directory. A PNG (1024x1024 or larger) or an
|
overwrite |
Logical. Whether to overwrite existing output directory. Default is FALSE. |
build |
Logical. Whether to build distributable packages. Default is TRUE. |
run_after |
Logical. Whether to run the application in development mode after export. Default is FALSE. |
open_after |
Logical. Whether to open the generated project directory after export. Default is FALSE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
List containing paths to the converted app and built Electron app (if built).
This is the main function of the package that orchestrates the entire process:
Validates the input Shiny application
Converts the Shiny app to the specified format (shinylive by default)
Sets up the Electron project structure
Optionally builds distributable packages
Optionally runs the application for testing
Two languages, five delivery strategies.
r-shiny or py-shiny plus runtime_strategy = "shinylive": app compiles to WebAssembly and runs inside the Electron window with no runtime on disk.
r-shiny or py-shiny plus "auto-download", "bundled", "system", or "container": app runs against a real R or Python process supplied by the chosen strategy.
# Simplest call: app_type autodetects, runtime_strategy defaults to shinylive
export(
appdir = "path/to/shiny/app",
destdir = "path/to/electron/output"
)
# Run against a real R process instead of shinylive
export(
appdir = "path/to/shiny/app",
destdir = "path/to/output",
runtime_strategy = "bundled"
)
# Pin language explicitly when autodetection is ambiguous
export(
appdir = "path/to/shiny/app",
destdir = "path/to/output",
app_type = "r-shiny",
runtime_strategy = "system"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.