Publishing a ShinyApp

Author

Ethan Tai

Published

March 7, 2022

How do I publish a ShinyApp?

Configuring ShinyApps Account on RStudio

First, we need to install and load the rsconnect package.

install.packages('rsconnect')
library('rsconnect')

Once you login to shinyapps.io, navigate to the token page.

Token Example

Then, we can access our own personal token, which we need to link to our RStudio session, by clicking show, show secret, and copying and pasting the command into RStudio.

Secret Command

The command should take the form as follows:

rsconnect::setAccountInfo(name='imlab',
              token=<token>,
              secret=<secret>)

At this point, if you have access to deploy the app, you can deploy it onto shinyapps.io with the command:

deployApp(appName='yourAppName')

If you are experiencing errors with the app deployment, deleting the app’s manifest.json may help resolve errors.