npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ahextechnology/social-handles

v1.0.2

Published

This project sets up various authentication strategies using Passport.js with support for Google, Facebook, Twitter, GitHub, and LinkedIn OAuth.

Downloads

25

Readme

Social-handles

Environment Variables

Make sure to set the following environment variables in your project:

PORT=3000
APP_URL=''
LOCALHOST_URL='http://localhost:{port}'

# Redirections
SUCCESS_REDIRECT='{app_url}/success'
FAILURE_REDIRECT='{app_url}/failure'

# Google Login
GOOGLE_CLIENT_ID='your-google-client-id'
GOOGLE_CLIENT_SECRET='your-google-client-secret'
GOOGLE_OAUTH_REDIRECT_URL='{app_url}/api/users/google/callback'

# Facebook Login
FACEBOOK_CLIENT_ID='your-facebook-client-id'
FACEBOOK_CLIENT_SECRET='your-facebook-client-secret'
FACEBOOK_OAUTH_REDIRECT_URL='{app_url}/api/users/facebook/callback'

# Twitter Login
TWITTER_CLIENT_ID='your-twitter-client-id'
TWITTER_CLIENT_SECRET='your-twitter-client-secret'
TWITTER_BEARER_TOKEN='your-twitter-bearer-token'
TWITTER_ACCESS_TOKEN='your-twitter-access-token'
TWITTER_ACCESS_TOKEN_SECRET='your-twitter-access-token-secret'
TWITTER_OAUTH_REDIRECT_URL='{app_url}/api/users/twitter/callback'

# GitHub Login
GITHUB_CLIENT_ID='your-github-client-id'
GITHUB_CLIENT_SECRET='your-github-client-secret'
GITHUB_OAUTH_REDIRECT_URL='{app_url}/api/users/github/callback'

# LinkedIn Login
LINKEDIN_CLIENT_ID='your-linkedin-client-id'
LINKEDIN_CLIENT_SECRET='your-linkedin-client-secret'
LINKEDIN_OAUTH_REDIRECT_URL='{app_url}/api/users/linkedin/callback'
LINKEDIN_AUTHENTICATION_URL='https://www.linkedin.com/oauth/v2/authorization'
LINKEDIN_OAUTH_ACCESSTOKEN_URL='https://www.linkedin.com/oauth/v2/accessToken'

Tested Dependencies and Versions

This package has been tested with the following dependencies and their respective versions:

  • axios: ^1.7.2
  • dotenv: ^16.4.5
  • passport: ^0.7.0
  • passport-facebook: ^3.0.0 (for Facebook SSO)
  • passport-github2: ^0.1.12 (for GitHub SSO)
  • passport-google-oauth: ^2.0.0 (for Google SSO)
  • passport-oauth2: ^1.8.0 (for LinkedIn SSO)
  • passport-twitter: ^1.0.4 (for Twitter SSO)

and Node Version is 20.15.0 To initialize Passport.js and manage sessions in your application, include the following middleware setup in your main server file:

    app.use(passport.initialize());
    app.use(passport.session());

Google SSO Setup

For getting clientID, ClientSecret from googole-auth do follow this steps Word.

For routing google API's use the below code

    router.get('/google', passport.authenticate('google', { scope: ['profile','email'] }))
    router.get('/google/callback', passport.authenticate('google', { failureRedirect: 'your-failure-page-url' , successRedirect: 'your-success-page-url'}))

Google SSO Testing

For a detailed implementation of Google SSO using Passport.js and how it integrates with this project, watch this Loom video.

Facebook SSO Setup

For getting clientID, ClientSecret from facebook-auth do follow this steps Word.

For routing facebook API's use the below code

    router.get('/facebook', passport.authenticate('facebook'));
    router.get('/facebook/callback', passport.authenticate('facebook', { failureRedirect: 'your-failure-page-url', successRedirect: 'your-success-page-url' }))

Facebook SSO Testing

For a detailed implementation of facebook SSO using Passport.js and how it integrates with this project and we need some extra meta verification then we will redirect that to success page but even though we are getting profle info, watch this Loom video.

Twitter SSO Setup

For getting consumerKey, consumerSecret from twitter-auth do follow this steps Word.

For routing twitter API's use the below code

    router.get('/twitter', passport.authenticate('twitter'));
    router.get('/twitter/callback', passport.authenticate('twitter', { failureRedirect: 'your-failure-page-url', successRedirect: 'your-success-page-url' }))

Twitter SSO Testing

For a detailed implementation of Twitter SSO using Passport.js and how it integrates with this project, watch this Loom video.

GitHub SSO Setup

For getting clientID, ClientSecret from github-auth do follow this steps Word.

For routing github API's use the below code

    router.get('/github', passport.authenticate('github'));
    router.get('/github/callback', passport.authenticate('github', { failureRedirect: 'your-failure-page-url', successRedirect: 'your-success-page-url' }))

GitHub SSO Testing

For a detailed implementation of github SSO using Passport.js and how it integrates with this project, watch this Loom video.

LinkedIn SSO Setup

For getting clientID, ClientSecret from linkedin-auth do follow this steps Word.

For routing linkedin API's use the below code

    router.get('/linkedin', passport.authenticate('linkedin'));
    router.get('/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: 'your-failure-page-url', successRedirect: 'your-success-page-url' }))

Linkedin SSO Testing

For a detailed implementation of linkedin SSO using Passport.js and how it integrates with this project, watch this Loom video.