twitchdev / authentication-node-sample Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
This does not seem to be working any longer.
When I click on the broken image link I get this response
{"status":400,"message":"invalid client"}
Is there a youtube video demonstrating this code?
As of February the package "request" has been deprecated and will no longer be supported.
I would recommend switching to "node-fetch" which is more likely to be maintained and is, ultimately, a cleaner method for making the request.
const fetch = require('node-fetch');
fetch('https://api.twitch.tv/helix/users', options)
.then( response => response.json())
.then( data => {
// magic happens with the parsed response JSON
done();
});
It may seem a little silly to create an issue on something intended to be a sample but deprecated packages are not returned in search results on npmjs.com which could make searching for documentation difficult for those adapting the sample.
I saw that you guys are using the generic passport oauth2 strategy to authenticate on Twitch. Have you considered using the specific passport strategy created to authenticate with Twitch? I'll leave the link to it in case you guys get interested in changing to it.
My friend ask it
Error when presenting data in HMTL.
Display Name, Bio and image is not showing.
HTML TEMPLATE:
var template = handlebars.compile(
Access Token | {{accessToken}} |
---|---|
Refresh Token | {{refreshToken}} |
Display Name | {{display_name}} |
Bio | {{bio}} |
Image | {{logo}} |
req.session.passport.user is returing:
{ data: [ { id: 'XXXXXX', login: 'XXXXXX', display_name: 'XXXXXXXXXX', type: '', broadcaster_type: '', description:
"XXXXXXXXXX", profile_image_url: 'XXXXXXX', offline_image_url: 'XXXXXXX', view_count: XXXXX } ], accessToken: 'XXXXXX', refreshToken: 'XXXXXXX'' }
Here you see that data[0].XXXX is the correct place for display_name, description and profile_image.
Regards
Codekuu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.