@securepool/react-sdk
v1.0.0
Published
SecurePool — React SDK. <SecurePoolProvider/>, useAuth() hook, and pre-built UI (LoginForm, SignupForm, OTPVerification, GoogleLoginButton, SessionList).
Downloads
91
Maintainers
Readme
@securepool/react-sdk
React SDK for the SecurePool authentication library — provider, hooks, and pre-built UI components.
npm install @securepool/react-sdkimport {
SecurePoolProvider,
LoginForm,
useAuth,
} from "@securepool/react-sdk";
function App() {
return (
<SecurePoolProvider
config={{ apiBaseUrl: "https://api.example.com", tenantId: "default" }}
>
<LoginForm onSuccess={() => console.log("Logged in!")} />
</SecurePoolProvider>
);
}
function Dashboard() {
const { user, logout, changePassword } = useAuth();
// ...
}What's included
<SecurePoolProvider />— wraps your app, manages auth state in localStorage.useAuth()hook —user,login,register,verifyEmail,forgotPassword,resetPassword,changePassword,logout,error,isLoading, ...- Pre-built components:
<LoginForm />,<SignupForm />,<OTPVerification />,<GoogleLoginButton />,<SessionList />.
Peers
react >=18 and react-dom >=18.
License
MIT © Lokesh
