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 🙏

© 2025 – Pkg Stats / Ryan Hefner

third-login-ts

v1.2.9

Published

node后台第三方登录插件,支持github、qq、sina、gitee、开源中国、钉钉

Downloads

28

Readme

node 服务端第三方登录,包括githubqqsinagitee、开源中国、钉钉。

安装插件

npm install third-login-ts

调用示例

以下已express为例

const {qq, git, sina} = require('third-login-ts')

sina = new sina({
  appId: 'xxxx',
  appkey: 'xxxx',
  host: 'http://localhost:8001', // 后台服务接口地址 如:http://localhost:8001,部署后请用正式地址
  redirectUrl: `/sina/login/callback`
})
// 前端点击登录后服务器自己的接口地址
// 插件会重定向到sina授权
router.get("/sina/login", async (req, res) => {
  sina.login(res)
})

// 开发者自己的回调接口地址
router.get("/sina/login/callback", async (req, res) => {
  // code 为 sina 回调返回的参数
  let code = req.query.code
  // userinfo 即为授权登录的sina用户信息
  let userinfo = await sina.callback()
})



git = new git({
  appId: 'xxxx',
  appkey: 'xxxx',
  host: 'http://localhost:8001', // 后台服务接口地址 如:http://localhost:8001,部署后请用正式地址
  redirectUrl: `/github/login/callback`
})

// 前端点击登录后服务器自己的接口地址
// 插件会重定向到github授权
router.get("/github/login", async (req, res) => {
  git.login(res)
})

// 开发者自己的回调接口地址
router.get("/github/login/callback", async (req, res) => {
  // code 为 github 回调返回的参数
  let code = req.query.code
  // userinfo 即为授权登录的github用户信息
  let userinfo = await git.callback()
})

qq = new qq({
  appId: 'xxxx',
  appkey: 'xxxx',
  host: 'http://localhost:8001', // 后台服务接口地址 如:http://localhost:8001,部署后请用正式地址
  redirectUrl: `/qq/login/callback`
})

// 前端点击登录后服务器自己的接口地址
// 插件会重定向到qq授权
router.get('/qq/login', async (req, res) => {
  qq.login(res)
})
// 开发者自己的回调接口地址
router.get('/qq/login/callback', async (req, res) => {
  // code 为 qq 回调返回的参数
  let code = req.query.code
  // userinfo 即为授权登录的qq用户信息
  let userinfo = await qq.callback()
})

其他示例同上,gitee、开源中国已解决token刷新问题,用户信息都会在callback返回,且token一并返回

开发平台地址

QQ互联

Sina新浪开放平台

Github

Gitee

开源中国

百度开放平台

演示地址

https://webxiu.javanx.cn

赞助

欢迎和感谢认可我们的企业及个人,在您力所能及下对我们提供慷慨赞助。