Comments (3)
Hi @ankoure, thanks for letting me know. Did you setup your credentials using the twitch_auth()
function as specified in the Authenticantion section of the README file?
You can setup an OAuth token by calling the twitch_auth()
function after you setup TWITCH_CLIENT_ID
and TWITCH_CLIENT_SECRET
as environment variables.
from rtwitchapi.
I added the TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET to the r environ file, then restarted R. I used the twitch_auth() function and it ran without an error but it did not prompt anything additional. Is twitch_auth() supposed to prompt something or should I be using the auth token in the function?
from rtwitchapi.
twitch_auth()
handles the authentication process automatically, so you never really have to deal with the tokens manually. What it does in the backend is:
- a
POST
request tohttps://id.twitch.tv/oauth2/token
is sent using the credentials (TWITCH_CLIENT_ID
andTWITCH_CLIENT_SECRET
) found in your.Renviron
file. - an access token is then created by the Twitch API and it is sent to you in the response of the request, as described in the Client credentials flow
- the received access token is read and passed to
httr
'sset_config()
so that it will be automatically passed as a header in future requests made byhttr
. - now any request made by the package's functions (e.g.
get_streams()
) is made with the token as a header.
In summary, twitch_auth()
obtains the token for you and automatically adds it to every future request made by rTwitchAPI
functions. If it ran without any error, then the other functions should work normally.
I think I'll add some kind of feedback in twitch_auth()
so that is becomes clearer that something happened in the background and you're now able to use the other functions.
from rtwitchapi.
Related Issues (3)
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 rtwitchapi.