Hi Guys,
Building a node.js app with express.js and I want to use the API V2. I already have google oauth integration with passport.js so it would be easier to use a passport strategy. What are people using for this stack?
options seem to be as follows… fill me in if there is a better option.
Any feedback appreciated.
Mick
back when i was working on a site with patreon oauth integration i created my own patreon client. v2 incredibly poorly documented tho
1 Like
Ok so I have my solution working now. For authentication, I used this forked and updated passport.js strategy…@oauth-everything/passport-patreon and for retrieving memberships, I made a direct request rather than use the library…
router.get('/patreon/memberships', (req: AuthenticatedRequest, res) => {
const membershipsUrl = formatUrl({
protocol: 'https',
host: 'patreon.com',
pathname: '/api/oauth2/v2/identity',
query: {
include: 'memberships',
}
});
request({
url: membershipsUrl,
headers: {
'Authorization': `Bearer ${req.user.patreon_access_token}`
},
rejectUnauthorized: false
}, function(err, res) {
if(err) {
console.error(err);
} else {
console.log(res.body);
}
});
});