@burdenoff/microfe-auth

中文文档
2026.1108.3发布于 2026/11/09TypeScriptES Module近 30 天下载 9784

Auth microfrontend for Burdenoff products

原始使用文档
文档目录4 节
  1. Getting Started
  2. Shell imports
  3. Workspace and project selection
  4. License

microfe-auth

Part of the Burdenoff platform by AlgoShred.

Getting Started

See AGENTS.md for development commands and architecture details.

Shell imports

Hosts that only need auth state or context-switcher hooks can use the public shell entries without statically importing auth routes and challenge UI:

import { useAuthStore } from '@burdenoff/microfe-auth/store';
import {
  useContextSwitcherData,
  useWorkspaceSyncEffect,
  useProjectSyncEffect,
} from '@burdenoff/microfe-auth/shell';

These entries re-export the same canonical store and hooks as the root entry; they do not create another store, change context loading, or defer logout cleanup. The root entry and its existing exports remain supported. Both new entries ship declarations, and the build checks their packed static graph. Consumers must adopt a published package version containing these exports; source-linked tests alone are not a published compatibility guarantee.

Workspace and project selection

The shared context switcher issues a workspace token and reads myProjects to show projects accessible to the current actor. An empty list is a valid workspace-only context: learners and other workspace members do not need create:project permission to open a product. Switching or restoring context never creates a project. Default project provisioning belongs to workspace creation; deliberate project creation remains a separate authorized action.

An empty successful response is retained for the current account and workspace to avoid repeated fetches. Changing accounts or resetting the project list causes a fresh read. Existing projects may still be selected automatically unless the user explicitly chose workspace-wide scope.

License

Proprietary — Copyright Burdenoff Consultancy Services Pvt. Ltd.

版本与发布记录

@burdenoff/microfe-auth 共发布 110 个版本,首次发布于 2026/05/11;过去 12 个月发布了 110 个版本。

版本发布日期距今
2026.1108.3latest2026/11/09今天
2026.1108.2alpha2026/11/09今天
2026.1108.12026/11/081 天前
2026.1107.32026/11/081 天前
2026.1107.22026/11/081 天前
2026.1107.12026/11/071 天前

关于 @burdenoff/microfe-auth 的常见问题

@burdenoff/microfe-auth 是什么?

Auth microfrontend for Burdenoff products

如何安装 @burdenoff/microfe-auth?

在项目目录运行 npm install @burdenoff/microfe-auth,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.0.0)、graphql(^16.12.0)、react-dom(^19.0.0)、@apollo/client(^4.0.9)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@burdenoff/microfe-auth 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@burdenoff/microfe-auth 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@burdenoff/microfe-auth 可以商用吗?

@burdenoff/microfe-auth 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@burdenoff/microfe-auth 的下载量有多少?

根据 npm 官方下载统计,@burdenoff/microfe-auth 在 2026/10/09 – 2026/11/07 这 30 天内被下载 9,784 次,日均约 326 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@burdenoff/microfe-auth 还在维护吗?

最新版本 2026.1108.3 发布于 2026/11/09(今天);至今共发布 110 个版本,其中过去 12 个月发布了 110 个;首次发布于 2026/05/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。