Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

passport-streamlabs

NPM version NPM downloads

Passport strategy for authenticating with Streamlabs on Node.js apps.

Installation

$ npm install passport-streamlabs --save

Usage

Configure Strategy

  1. Register an app on Streamlabs.
  2. Decide what scopes you're gonna use.
  3. Register the strategy
var StreamlabsStrategy = require('passport-streamlabs').Strategy,
    passport           = require('passport');

passport.use(new StreamlabsStrategy({
    clientID:     'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
    scope:        'SCOPES', // e.g., 'donations.read donations.create' or ['donations.read', 'donations.create']
    callbackURL:  'YOUR_REDIRECT_URI'
}, function(accessToken, refreshToken, profile, done) {
    return done(undefined, profile);
}));

Authenticate requests

app.get('/auth/streamlabs/authorize', passport.authenticate('streamlabs'));

app.get('/auth/streamlabs/callback', passport.authenticate('streamlabs', { failureRedirect: '/auth/streamlabs/authorize' }), function(req, res) {
    // At this point, the authentication was successful.
});

Here's a condensed example using Express.

About

Streamlabs authentication strategy for Passport.js

Topics

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.