{"_id":"passport-twitch-new","_rev":"4-7e51f28fae2e6e5a8c27c6ded70326aa","name":"passport-twitch-new","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1-alpha":{"name":"passport-twitch-new","version":"0.0.1-alpha","description":"Twitch (OAuth) authentication strategies using the new Twitch API for Passport.","keywords":["passport","new","twitch","auth","authn","authentication","identity","oauth","oauth2","strategy"],"repository":{"type":"git","url":"git://github.com/nigh7sh4de/passport-twitch.git"},"bugs":{"url":"http://github.com/nigh7sh4de/passport-twitch/issues"},"author":{"name":"Dennis Plotnik","email":"plotnikd@gmail.com","url":"http://github.com/nigh7sh4de"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./index.js","dependencies":{"passport-oauth2":"^1.1.2","pkginfo":"0.2.x"},"devDependencies":{"vows":"0.6.x"},"engines":{"node":">=0.10.0"},"maintainers":[{"name":"nigh7sh4de","email":"plotnikd@gmail.com"}],"directories":{},"homepage":"https://github.com/nigh7sh4de/passport-twitch","gitHead":"dd51ee51a1b71952739b9f7bd0a311b62f2c464b","_id":"passport-twitch-new@0.0.1-alpha","_npmVersion":"6.0.0","_nodeVersion":"10.0.0","_npmUser":{"name":"nigh7sh4de","email":"plotnikd@gmail.com"},"dist":{"integrity":"sha512-Wn8YB7udCyOVCkR4ksRZxbLu0otyWnBaj5AI4BtXHk+1lSFLbjJI/idVdfUQi6H+BfgryCv7HhdrcOVJ2w2URw==","shasum":"078445dbfcf9b21bbf942adc3fcc52d45b371842","tarball":"https://registry.npmjs.org/passport-twitch-new/-/passport-twitch-new-0.0.1-alpha.tgz","fileCount":7,"unpackedSize":13269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa773tCRA9TVsSAnZWagAAgNYP/1cSf1FZ4cvktRK/61FM\ndsLwOGwtfu30h9BCcaDNxadVM8lYvNCoggtidJbnjWPLNMA37dWRxpdOtT1Y\nAoS3Wy6JFkk7iTvFlQ0nF5qSABiYaRrv9kReDmGKCuojWFqZufvE9p12O3Mm\n3ZeO1DvSkFb/Och88jKhXKLKqDjTLMJGO82nUlyxdeHSnbCwM63EbKtN+Jbm\nR7XfHR+G414J9xWMT5IkCIbZbhBevcpCI4yb70I+EAE1SkaCGBdqtq3U6as3\n8R+9Z3pbx5UtfJfhqV2mAw4RFcxI0m+fbbQbOVPYWRjeUsjKMLhPNB2DybD8\nmiW5LYJKxxqvii59IWgihC4/I1a68Y2a6DN5cy1iKneGoWfSRwU49v8sart5\ngjoUl+1z+ocKHeqw/h9DYi9Y+DcMs/uTssvahOrHOnA1AYJmKAcHknR3Fhja\nELsw/lC2YQY8ehx1PjaBWYnKoOYis6RYtWVrOo02Z/TDudGTdCytGHKJ1pD1\nWWIOLOLt6gW/TFGt0HJkxIliL4RnC+pN6vHUJq37zzKBcMBC5/+sEUlh2ttL\nZzMQIysSYocedHF/Xt7xbYvUbp3vZWpW6regAUwffnYmoPNBdKWQkQOb5Jez\n1uEeb06oPuPBTB8CgL+hPd2Jh7FCWO/dt5sT09JZK+CSMspg6fUqMSLZ/k48\n4RaI\r\n=7PER\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPpcX7A5TRdsqmAVbiNQWLXnCniMfCiwFykmJBa21OHAiBDC3basTDUL2WUZUTtZ1BjDag86sP23CumEx6ZJ4DF5A=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-twitch-new_0.0.1-alpha_1525661164759_0.7051627319292726"},"_hasShrinkwrap":false},"0.0.1":{"name":"passport-twitch-new","version":"0.0.1","description":"Twitch (OAuth) authentication strategies using the new Twitch API for Passport.","keywords":["passport","new","twitch","auth","authn","authentication","identity","oauth","oauth2","strategy"],"repository":{"type":"git","url":"git://github.com/nigh7sh4de/passport-twitch.git"},"bugs":{"url":"http://github.com/nigh7sh4de/passport-twitch/issues"},"author":{"name":"Dennis Plotnik","email":"plotnikd@gmail.com","url":"http://github.com/nigh7sh4de"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./index.js","dependencies":{"jsonwebtoken":"^8.2.1","passport-oauth2":"^1.4.0","pkginfo":"0.2.x"},"devDependencies":{"vows":"0.6.x"},"engines":{"node":">=0.10.0"},"maintainers":[{"name":"nigh7sh4de","email":"plotnikd@gmail.com"}],"directories":{},"homepage":"https://github.com/nigh7sh4de/passport-twitch","gitHead":"b54674486dc059d1d7f4dcff23ddc206260bf895","_id":"passport-twitch-new@0.0.1","_npmVersion":"6.0.0","_nodeVersion":"10.0.0","_npmUser":{"name":"nigh7sh4de","email":"plotnikd@gmail.com"},"dist":{"integrity":"sha512-GYdv/JI4Lp+G7FYNJlpKntHmjafwZCl0Rrp44pCDWjn6Ml0eaC6i4Fp1QU3m2XlpvVslLtZWeNtgMmfgPmbEew==","shasum":"321c0cb4abd73ca2c9851ff4e5f675b3e278825e","tarball":"https://registry.npmjs.org/passport-twitch-new/-/passport-twitch-new-0.0.1.tgz","fileCount":7,"unpackedSize":16327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+MyvCRA9TVsSAnZWagAAzLMQAKF6XhVaowAOQixzUvL/\n0D8LOeXOVN/NKf6YqY9kl0ilmjB1T6SZNDxEB2mv23VsaULNN3VgobBt54+W\nQA8lOoJlv3gWK2ATwB7dkcOmTaXizQtaL7Xrl6QakQiCSq879lzPSh+oBYng\nT1rSOwAvkC8d33uJQOfKvPskRIwf3LxCrsr9yrCyTkx8Gzo2ixxMjxpWilVa\nt++eTHFEJ9pAcHXSNH5alfbbML2l0rv3Xk5qMSTE7sY+X4gOz1E1KBCCECrR\n3bsOkITMF3i7EsHYyoPvABWirI54an/hJ+kK2EqFBDy49SG3uXp3HzbvY/oX\npOUnKc3eHU9x1DLny/2Ew4nKjYJjfYPkHdpfTNJx2TC9Np3294T7ftIzOFWa\nHTEzkozrkWo9n6zRZ3ATxtMLrHGdBmAbSNPA/SVowwv7KmybnaDi9Bxjgdcu\nSCk6PKRc9FY0Ol3PAQDlx0ptCAzO7KeNYqKpzN2aWm8OmnCCugs28ZHZzIrk\nrIi/1uf4R/izNCCVLMybHEt6JJbqiE/nuvWLPtWLaZ8RtlEDJdneXz63B5sS\nuh48gx35ohcWxSqYq6NFHl89400lifGw3x/vhnacMtATHBnYUpnLeBpn/0FB\n4n5DxoNiRap/M+3g9VYOXMGoUZOzhL3qxLBTpvPYpe6YWszpVyv2yY3pKt4t\nbm2v\r\n=EOt5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBSFyEmVTCGZoklfXE48vwmNY8xwNx1P55jEsVcbs6oQIgbA5i1IWZdxBdq6QjCVClCoOKd4oP5lFMxpINyPd14iw="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-twitch-new_0.0.1_1526254766114_0.5135229526077456"},"_hasShrinkwrap":false},"0.0.2":{"name":"passport-twitch-new","version":"0.0.2","description":"Twitch (OAuth) authentication strategies using the new Twitch API for Passport.","keywords":["passport","new","twitch","auth","authn","authentication","identity","oauth","oauth2","strategy"],"repository":{"type":"git","url":"git://github.com/nigh7sh4de/passport-twitch.git"},"bugs":{"url":"http://github.com/nigh7sh4de/passport-twitch/issues"},"author":{"name":"Dennis Plotnik","email":"plotnikd@gmail.com","url":"http://github.com/nigh7sh4de"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./index.js","dependencies":{"jsonwebtoken":"^8.2.1","passport-oauth2":"^1.4.0","pkginfo":"0.2.x"},"devDependencies":{"vows":"0.6.x"},"engines":{"node":">=0.10.0"},"maintainers":[{"name":"nigh7sh4de","email":"plotnikd@gmail.com"}],"directories":{},"homepage":"https://github.com/nigh7sh4de/passport-twitch","gitHead":"ed5d90277cdf323c1636ab77ec35df276c38e0d7","_id":"passport-twitch-new@0.0.2","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-cNBwq4yUGO/H6NI42OAJTAXIOuQhFkfce7YG0h3HtUr5JIRwXXsHQLUhtiyO3fO+Dp1NItOjtUc384mkrpcQwQ==","shasum":"dcac14b2d1d2e8398fa34efe0112527251306303","tarball":"https://registry.npmjs.org/passport-twitch-new/-/passport-twitch-new-0.0.2.tgz","fileCount":7,"unpackedSize":16447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbNe0CRA9TVsSAnZWagAARyEP/Rlo1s5nlgWuS7z4SXR8\nrKE3QW8YVZaX8PCr+3ipinntVs7spSZc7Uq8EfL+vyiOKneIivT8ury1TKnN\nM498mT6WAHdePHfEwIb0OMFqARekK64WWVRpzXd2ytm9nhy8YXZnUadbZd7A\n8grOilQ2LGR3fsuzAhqGlahqAcI9maLaskz1FQFVgFkco0XSIFzTf2K5LpAT\nzV1GcM0d4iXQgaus2DC5cAxNKkHZMZ8kbNV7/Y1HvNBPkUhN18xTt1uqX+2D\nfy6FcTmfYc8m92tFw/ce1KctQqEgkFW07Crwj4cBujFcjPnayIszfGQS/UJX\n7qxusW4Q60ugPmjL8nxjoaoBVc6ararUobwgWNOCQYoBE3v4Jej0JHaxpg0q\nFrMz5PWPVBi4SycDXa70fz4kWw+JxEQVjKejTwaswj0d2O3msXrLC3PCsP+y\n/poDAhzUbYy1IgtoGhe6CrC60uh9xkRFKMk+ctJh3DYTTh4/2GVssMHflpu3\nWee2f5FfhWe6yf4ms99cAitRRYsu8MsJGAYEKMlrCPjRvCQOy4UZmybyk89M\n7XFIYQcLzbgTDn0cg0mICvmH5NAuMF4U+VStPDxNMPaRtEim3jPnyH4xOGbK\nGaJf52BPAfGktNTwJC+ri588P03jDcQWjXvb8lM8Y8q3JjIdc7aI+k5f+oJT\nuRIg\r\n=iTA0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEC7Qojj/JNuwYzhZ12qUNfFirbG4Yum7zcgmVRBQpVSAiAr1kKtVYNCyT8r0x0CYA8D880IKqnVeWCcAsUtYYxNgA=="}]},"_npmUser":{"name":"nigh7sh4de","email":"plotnikd@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-twitch-new_0.0.2_1600968627903_0.18108731778375597"},"_hasShrinkwrap":false},"0.0.3":{"name":"passport-twitch-new","version":"0.0.3","description":"Twitch (OAuth) authentication strategies using the new Twitch API for Passport.","keywords":["passport","new","twitch","auth","authn","authentication","identity","oauth","oauth2","strategy"],"repository":{"type":"git","url":"git://github.com/nigh7sh4de/passport-twitch.git"},"bugs":{"url":"http://github.com/nigh7sh4de/passport-twitch/issues"},"author":{"name":"Dennis Plotnik","email":"plotnikd@gmail.com","url":"http://github.com/nigh7sh4de"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./index.js","dependencies":{"passport-oauth2":"^1.6.0","pkginfo":"^0.4.0"},"devDependencies":{"vows":"0.8.x"},"engines":{"node":">=0.14.0"},"maintainers":[{"name":"nigh7sh4de","email":"plotnikd@gmail.com"}],"directories":{},"homepage":"https://github.com/nigh7sh4de/passport-twitch","_id":"passport-twitch-new@0.0.3","gitHead":"62a24bbd7cf47c0025097d1c7c7dff7fea3e2687","_nodeVersion":"18.18.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-f835Ub+9LX6r+r1kFuyp+WoYLT1HH8g14aijy4ls3Y0NbZE0qnxdbVi/y/GNpPf90+VcQAyAjFgw8HZp05G/UQ==","shasum":"245285ff2639d22897edb490994c32c0e8e70e1a","tarball":"https://registry.npmjs.org/passport-twitch-new/-/passport-twitch-new-0.0.3.tgz","fileCount":6,"unpackedSize":11144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBasgUJ+QntFAMJBwaqlpv6DcPhkNelBJhLsfMBD789AIgKmhXshNsm3pVer0p7OIY8dl5HaHTkaiH7cjXbbzsXFQ="}]},"_npmUser":{"name":"nigh7sh4de","email":"plotnikd@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-twitch-new_0.0.3_1713451025417_0.8283994779304875"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-07T02:46:04.757Z","0.0.1-alpha":"2018-05-07T02:46:04.856Z","modified":"2024-04-18T14:37:05.751Z","0.0.1":"2018-05-13T23:39:26.163Z","0.0.2":"2020-09-24T17:30:28.092Z","0.0.3":"2024-04-18T14:37:05.571Z"},"maintainers":[{"name":"nigh7sh4de","email":"plotnikd@gmail.com"}],"description":"Twitch (OAuth) authentication strategies using the new Twitch API for Passport.","homepage":"https://github.com/nigh7sh4de/passport-twitch","keywords":["passport","new","twitch","auth","authn","authentication","identity","oauth","oauth2","strategy"],"repository":{"type":"git","url":"git://github.com/nigh7sh4de/passport-twitch.git"},"author":{"name":"Dennis Plotnik","email":"plotnikd@gmail.com","url":"http://github.com/nigh7sh4de"},"bugs":{"url":"http://github.com/nigh7sh4de/passport-twitch/issues"},"readme":"# passport-twitch\n\nTwitch is a trademark or registered trademark of Twitch Interactive, Inc. in the U.S. and/or other countries. \"passport-twitch\" is not operated by, sponsored by, or affiliated with Twitch Interactive, Inc. in any way.\n\n[Passport](http://passportjs.org/) strategies for authenticating with [Twitch](http://www.twitch.tv/)\nusing OAuth 2.0 on the New Twitch API.\n\nThis module lets you authenticate using Twitch in your Node.js applications.\nBy plugging into Passport, Twitch authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/) and [Koa](http://koajs.com/).\n\n## Install\n```bash\n$ npm install passport-twitch-new\n```\n## Usage of OAuth 2.0\n\n#### Configure Strategy\n\nThe Twitch OAuth 2.0 authentication strategy authenticates users using a Twitch\naccount and OAuth 2.0 tokens. The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a client ID, client secret, and callback URL.\n\n```javascript\nvar passport       = require(\"passport\");\nvar twitchStrategy = require(\"passport-twitch-new\").Strategy;\n\npassport.use(new twitchStrategy({\n    clientID: TWITCH_CLIENT_ID,\n    clientSecret: TWITCH_CLIENT_SECRET,\n    callbackURL: \"http://127.0.0.1:3000/auth/twitch/callback\",\n    scope: \"user_read\"\n  },\n  function(accessToken, refreshToken, profile, done) {\n    User.findOrCreate({ twitchId: profile.id }, function (err, user) {\n      return done(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `\"twitch\"` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```javascript\napp.get(\"/auth/twitch\", passport.authenticate(\"twitch\"));\napp.get(\"/auth/twitch/callback\", passport.authenticate(\"twitch\", { failureRedirect: \"/\" }), function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect(\"/\");\n});\n```\n\nOptionally, the `forceVerify` option can be set to `true` to indicate\nthat the user should be re-prompted for authorization:\n\n```javascript\napp.get(\"/auth/twitch\", passport.authenticate(\"twitch\", {forceVerify: true}));\n```\n\n## Example\n\n```javascript\nvar express        = require(\"express\");\nvar bodyParser     = require(\"body-parser\");\nvar cookieParser   = require(\"cookie-parser\");\nvar cookieSession  = require(\"cookie-session\");\nvar passport       = require(\"passport\");\nvar twitchStrategy = require(\"passport-twitch\").Strategy;\n\nvar app = express();\n\napp.set(\"views\", \"./views\");\napp.set(\"view engine\", \"ejs\");\n\n// Middlewares\napp.use(bodyParser.urlencoded({ extended: true }));\napp.use(cookieParser());\napp.use(cookieSession({secret:\"somesecrettokenhere\"}));\napp.use(passport.initialize());\napp.use(express.static(\"./public\"));\n\npassport.use(new twitchStrategy({\n    clientID: \"098f6bcd4621d373cade4e832627b4f6\",\n    clientSecret: \"4eb20288afaed97e82bde371260db8d8\",\n    callbackURL: \"http://127.0.0.1:3000/auth/twitch/callback\",\n    scope: \"user_read\"\n  },\n  function(accessToken, refreshToken, profile, done) {\n    // Suppose we are using mongo..\n    User.findOrCreate({ twitchId: profile.id }, function (err, user) {\n      return done(err, user);\n    });\n  }\n));\n\npassport.serializeUser(function(user, done) {\n    done(null, user);\n});\n\npassport.deserializeUser(function(user, done) {\n    done(null, user);\n});\n\napp.get(\"/\", function (req, res) {\n    res.render(\"index\");\n});\n\napp.get(\"/auth/twitch\", passport.authenticate(\"twitch\"));\napp.get(\"/auth/twitch/callback\", passport.authenticate(\"twitch\", { failureRedirect: \"/\" }), function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect(\"/\");\n});\n\napp.listen(3000);\n```\n\n## License\n\nThe MIT License (MIT)\n\nFull text in LICENSE file","readmeFilename":"README.md"}