Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using private GitHub package with ShinyApps.io

I am having trouble making my ShinyApps.io account install a private GitHub dependency:

First, on ShinyApps.io, I have authorized private repository access:

private access

Second, in my package that I am deploying, I have added the private dependency as a Remotes package in the DESCRIPTION file:

Remotes:
    myOrg/myDependency

Third, ShinyApps.io is and authorized application on GitHub under the repository settings.

However, when I attempt to manually deploy, ShinyApps is unable to find myDependency. I get an error that states:

Warning: Unable to determine the repository for package myDependency

What else do I need to check to be sure ShinyApps.io can reach and use my dependency

like image 824
Dylan Russell Avatar asked Nov 18 '25 18:11

Dylan Russell


1 Answers

Going to focusing on getting this working and not necessarily the most elegant or right solution here.

  1. Revoke access to shinyapps at https://github.com/settings/applications and re-establish the connection from shinyapps (make sure to include the organizational grant if your dependency repo is owned by an org and not you personally).

  1. Make the dependency install from github a source script as part of the beginning of your app launch?

Something like:

app.r

library(dplyr)
library(shiny)

source(private_dependency.R)

*app code here*

private_dependency.R

library(devtools)
install_github("hadley/private", auth_token = "abc")

Where auth_token is a value you generated at: https://github.com/settings/tokens

Comments on auth_token storage from the docs:

To install from a private repo, use auth_token with a token from https://github.com/settings/tokens. You only need the repo scope. Best practice is to save your PAT in env var called GITHUB_PAT.

Reference


  1. Support ticket? It just doesn't seem to me like anything about the github process here is verbose enough to know what's really going on.
like image 124
sgdata Avatar answered Nov 21 '25 10:11

sgdata