
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@autolabz/auth-sdk
Advanced tools
AutoLab 认证 SDK - React 组件库
npm install @autolabz/auth-sdk
import { AuthProvider } from '@autolabz/auth-sdk';
function App() {
const authServiceUrl = import.meta.env.VITE_AUTH_API_BASE_URL;
return (
<AuthProvider authServiceUrl={authServiceUrl}>
<YourApp />
</AuthProvider>
);
}
import { AuthAvatar } from '@autolabz/auth-sdk';
function Header() {
return (
<div className="header">
<h1>我的应用</h1>
<AuthAvatar authPortalUrl={import.meta.env.VITE_OAUTH_PROFILE_URL} />
</div>
);
}
import { useAuth } from '@autolabz/auth-sdk';
function UserInfo() {
const { isAuthenticated, user, logout } = useAuth();
if (!isAuthenticated) {
return <div>请登录</div>;
}
return (
<div>
<p>欢迎, {user.nickname}</p>
<button onClick={logout}>退出登录</button>
</div>
);
}
| Props | 类型 | 必需 | 描述 |
|---|---|---|---|
children | ReactNode | ✅ | 子组件 |
authServiceUrl | string | ✅ | 认证服务 API 基础地址 |
返回值:
{
isAuthenticated: boolean;
user: User | null;
login: (user: User, refreshToken: string) => void;
logout: () => Promise<void>;
refreshAuth: () => void;
}
| Props | 类型 | 必需 | 描述 |
|---|---|---|---|
authPortalUrl | string | ❌ | 认证门户 URL(建议显式传入完整 URL) |
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建
npm run build
# 测试
npm test
MIT
FAQs
AutoLab 认证 SDK - React 组件库
We found that @autolabz/auth-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.