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

@aardwin/auth-browser

v0.4.0

Published

aardwin 嵌入式 OAuth 登录组件 —— <aardwin-auth> Web Component

Readme

@aardwin/auth-browser

npm version MIT license

中文 | English

可嵌入的 <aardwin-auth> OAuth 登录 Web Component(微信、Google、Outlook、GitHub、Discord、邮箱验证码):Shadow DOM、零依赖,任意框架可用。同包附带 <aardwin-account> 身份管理组件(内联绑定 / 解绑)。

安装 + 最小用法

npm install @aardwin/auth-browser
import '@aardwin/auth-browser'; // side-effect:注册 <aardwin-auth> 与 <aardwin-account>
<aardwin-auth site-id="YOUR_SITE_ID"></aardwin-auth>

不用打包器?构建 IIFE 产物(bun run build:iifedist/aardwin-auth.iife.js),用 <script> 标签引入:

<script src="/aardwin-auth.iife.js"></script>
<aardwin-auth site-id="YOUR_SITE_ID"></aardwin-auth>

元素会从 aardwin API 拉取你站点配置的 provider 列表,按 provider 渲染按钮 —— 你永远不需要硬编码 provider。按钮顺序固定:微信 → Google → Outlook → GitHub → Discord → 邮箱。

属性参数

<aardwin-auth>

| 属性 | 必填 | 说明 | | --- | --- | --- | | site-id | 是 | 在 aard.win 控制台 创建的站点 ID,决定拉取哪些 provider 按钮 | | i18n | 否 | 'zh' \| 'en';缺省按 navigator.language 自动检测,默认英文 | | callback-path | 否 | 显式指定回调路径(如 /callback);非空时 SDK 在跳转 URL 中追加 return_url,缺省时 bff 回退站点注册的 callbackUrl |

<aardwin-account>

| 属性 | 必填 | 说明 | | --- | --- | --- | | site-id | 是 | 站点 ID;决定可绑定的 provider | | code | 是 | 服务端用 createAccountHandoff() 铸造的一次性 handoff code(60 秒、单次使用) | | i18n | 否 | 'zh' \| 'en';缺省自动检测 |

React 项目:import '@aardwin/auth-browser/react.d.ts' 获得 JSX 类型声明(兼容 React 18 / 19、Next.js 15)。

安全模型

  • CSRF state nonce 由组件自己写入 SameSite=Lax cookie(aard_win_auth_state),你的回调路由负责校验。
  • 前端零密文 —— client-secret 只留在你的后端,仅配合 @aardwin/auth-server 使用。
  • 回调 code 一次性(60 秒过期、原子消费)。

效果预览

▶ 演示视频:https://aard.win/sdk-demo.mp4

深入阅读

许可证

MIT