Comments (7)
Hi @gbultman
The simple answer is that when your application is deployed and run on Heroku, it's then running on the server side, which is headless, and therefore cannot run a browser or any user interface for that matter.
What is the OAuth2 token used for? Is it so that your R code can consume a 3rd party service?
Regards
Chris
from heroku-buildpack-r.
Thanks for the prompt reply, Chris. Yeah. Specifically, Hubspot CRM data. Should I be looking into your docker solution? I'm pretty new to the web deployment side of things, but pretty familiar with R. RServer looks good but then I'd have to ditch Heroku, I think.
from heroku-buildpack-r.
The easiest way around this would be to use a Hubspot API key instead of using OAuth2 to authenticate.
You will need to generate/retrieve the Hubspot API key and then change your app to use it to authenticate instead of using the OAuth method. Use an environment variable to "pass through" the key from the host to your R code, such as:
hubspotApiKey <- Sys.getenv('HUBSPOT_API_KEY')
# code to instantiate Hubspot client, providing hubspotApiKey...
Then configure your app's environment variables on Heroku to include the API key. This way the code is the same for both local and deployed scenarios.
Alternatively, if you intend for you application to be used by other people, and have it connect to their Hubspot accounts, then you will need to implement the Authorization Code Flow, which is quite a bit more involved to implement.
from heroku-buildpack-r.
... and, in this example the docker version of the buildpack would need to be implemented in much the same way. I.e. It also runs headless, so won't have access to the browser on the server side.
from heroku-buildpack-r.
Hi @gbultman
Did you manage to get it working?
from heroku-buildpack-r.
I did. I ended up just saving the token in the root directory. Right now, it is doing stale refreshes, but I plan on just getting a service token. I was able to use that for manipulating things on my google drive - saving data etc. It's not ideal, but it works for now.
Thanks for your help.
from heroku-buildpack-r.
Okay thanks. I'll close the issue.
from heroku-buildpack-r.
Related Issues (20)
- I would really appreciate a walkthrough for a regular R user HOT 3
- renv 12 in my renv.lock file breaks the 'compilation' HOT 5
- GPG error HOT 3
- Rplumber test application delivers error HOT 5
- Increasing timeout HOT 1
- Support heroku-20 stack HOT 1
- Building with dokku HOT 2
- IsoSpecR not installed
- Skip BUILD_DIR to /app rsync when building in /app
- There is no package called 'renv' HOT 2
- Multiple-app hosting unavailable HOT 6
- Timeout when installing HOT 3
- Slow build time - Caching issue? HOT 2
- Add Support for Heroku-22 HOT 9
- Add telegram.bot example and default packages HOT 6
- Use reticulate package HOT 1
- Aptfile installation fails HOT 1
- Could I use cloud native build packs? HOT 2
- renv 1.0.2 Error in if (n == 1) word else paste(word, "s", sep = ""): app[web.1]: the condition has length > 1 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-r.