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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bdfint/bdfint-sso-sdk

v1.1.2

Published

统一账户管理(Unified Account Manager) Javascript SDK 域名:[base-sso.stable-test.bdfint.cn]

Readme

bdfint-auth-sdk

统一账户管理(Unified Account Manager) Javascript SDK
域名:[base-sso.stable-test.bdfint.cn]

安装和引入方式

使用 npm 或者 yarn 安装

$ npm install @bdfint/bdfint-sso-sdk
$ yarn add @bdfint/bdfint-sso-sdk
const AuthSdk = require("bdfint-sso-sdk").default; // ES5
import AuthSdk from "bdfint-sso-sdk"; // ES6

使用方法

step1: 组件加载完毕时调用inituseEffect,或者 componentDidMounted 中调用

AuthSdk.init({
  clientKey: "客户端ID", // 必填
  redirect_uri: "登录成功后跳转的地址", // 必填
  baseUrl:"登录页面地址"//必填  //http://base-sso.stable-test.bdfint.cn/login
  display: 'POP' //设置为POP时为弹窗登录,不设置display时默认为打开新页面登录
  });

step2: 根据业务场景手动调用登录函数(根据登录模式传递不同的 display 参数)

例子 1: 弹出遮罩层登录(弹出一个带遮罩的 iframe)login

AuthSdk.init({
  baseUrl:"登录页面地址"//必填  //http://base-sso.stable-test.bdfint.cn/login
  client_id: "客户端ID", // 必填
  display: 'POP', // 必填
  redirect_uri: "登录成功后跳转的地址", // 必填
});
AuthSdk.login()

例子 2: 跳转到登录页登录login

AuthSdk.init({
  baseUrl:"登录页面地址"//必填  //http://base-sso.stable-test.bdfint.cn/login
  client_id: "客户端ID", // 必填
  redirect_uri: "登录成功后跳转的地址", // 必填
});
AuthSdk.login();

step3: 获取用户信息

AuthSdk.getCurrentUser(); //返回一个Promise

step4: 退出

AuthSdk.logout(); //返回一个Promise

方法列表

| name | 说明 | 返回值 | | --------------------------------- | ------------------------------- | ------- | | init | 初始化配置 | | | login | 登录 | | | getCurrentUser | 获取登录用户的信息,返回 promise | promise | | logout | 退出登录 | | | register | 跳转到注册页,baseUrl | | | toUserInfo | 跳转到个人中心页面 | |

init

// @param option {object} 初始化配置参数
AuthSdk.init = function(options){ ... }
// opition详细配置:
options = {
  display: '登录模式(POP/其他)设置为POP则为弹窗登录,不设置或设置为其他值则跳转到登录页面登录',
  clientKey: '你的客户端ID',
  redirectUrl: '登录成功后的回调地址',
  baseUrl: '你要使用的登录/注册地址',
}

init 方法参数对象说明

| key | 说明 | 类型 | 默认值 | | ----------- | --------------------------- | ------ | ------------------------------------------- | | display | 以哪种方式进行登录 | | | | clientKey | 调用 AuthSdk 的业务平台 ID | string | | | redirectUrl | 登录成功后的回调地址 string | | | baseUrl | 自定义登录页地址 | string | http://base-sso.stable-test.bdfint.cn/login |

打包发布到NPM

首先注册一个NPM账号,然后在项目根目录中进入命令行终端,执行命令npm publish,首次执行需要按照提示输入账号密码。 注意: 每次执行npm publish时需要修改package.json文件中的version,确保每次都不一样