@noauth/react
v0.0.1
Published
noauth.sh react components
Readme
@noauth/react
React components for noauth.sh - Passwordless biometric authentication.
Installation
npm install @noauth/react
# or
pnpm add @noauth/react
# or
yarn add @noauth/reactBasic Usage
import React, { useState } from "react";
import { NoAuthLogin, type AuthResponse } from "@noauth/react";
function App() {
const [authResult, setAuthResult] = useState<AuthResponse | null>(null);
const handleSuccess = (payload: AuthResponse) => {
console.log("Authentication successful:", payload);
setAuthResult(payload);
};
return (
<div>
<NoAuthLogin
apiKey="your-api-key"
onSuccess={handleSuccess}
rememberEmail={true}
forceEmailVerification={false}
/>
</div>
);
}Components
NoAuthLogin
Main authentication component that handles the complete login flow.
Props
apiKey(string, required): Your noauth.sh API keyonSuccess(function, required): Callback executed when authentication is successfulemail(string, optional): Initial emailrememberEmail(boolean, optional): Whether to remember email in localStorage (default: true)forceAuthQr(boolean, optional): Force QR authentication (default: false)forceEmailVerification(boolean, optional): Force email verification (default: false)baseUrl(string, optional): Custom base URL for the API
NoAuthLogo
noauth.sh logo component.
Props
className(string, optional): CSS class for custom styling
Development
Playground
To test components during development:
cd packages/react
pnpm playgroundBuild
To build the library:
cd packages/react
pnpm buildLicense
MIT
More Information
Visit noauth.sh for more information about the platform.
