光环标志
光环基地文档
文档›JavaScript SDK 参考›React reference

JavaScript SDK: React reference

Reactive authentication state for React: a context provider, hooks and conditional wrappers.

6分钟 读取·级别 参考·修改于 2026年10月12日
此页面尚不支持您的语言。它以英文显示。
该英文文本是根据法文原文自动生成的,尚未经过审查。
#
功能

Exported functions

FunctionDescription
function AuthProvider({ client, children, initialSession }: AuthProviderProps): unknownWraps your application to provide reactive Aurabase authentication context.
function useAuth(): AuthContextValueAccess the core Aurabase authentication state and actions.
function useUser(): User | nullReturns the currently authenticated user, or null if unauthenticated.
function useSession(): Session | nullReturns the current active session.
function SignedIn({ children }: { children: ReactNode; }): unknownConditional component rendering children only when a user is signed in.
function SignedOut({ children }: { children: ReactNode; }): unknownConditional component rendering children only when NO user is signed in.
Generated page

This page is generated from the type declarations and comments of the SDK, so it cannot drift from the published code. For worked examples, read the guides.

最后更新· 2026年10月12日