OxyHQ Web Authentication SDK — headless auth with React hooks for Next.js, Vite, and web apps
npm install @oxyhq/authOxyHQ Web Auth SDK. Headless React hooks for web applications. Zero React Native or Expo dependencies.
``bash`
npm install @oxyhq/auth
- @oxyhq/corereact
-
- @tanstack/react-queryzustand
- socket.io-client
- sonner
-
- WebOxyProvider — React context provider with auth state
- useAuth — hook for signIn, signOut, user, isAuthenticated
- useWebOxy — full context access including sessions, switchSession, clearSessionState
- Query hooks — useCurrentUser, useUserProfile, usePrivacySettings, useSecurityActivity, and more
- Mutation hooks — useUpdateProfile, useUploadAvatar, useSwitchSession, useLogoutSession, and more
- Stores — authStore, assetStore, accountStore, followStore (zustand)
- Session management utilities
`tsx
import { WebOxyProvider, useAuth } from '@oxyhq/auth';
import type { User } from '@oxyhq/core';
function App() {
return (
);
}
function YourApp() {
const { user, isAuthenticated, signIn, signOut } = useAuth();
if (!isAuthenticated) {
return ;
}
return
Welcome, {user?.name}
;