Install the package
Albatroz is designed to drop into an existing React or Next.js codebase with a predictable forgot-password flow. Install it in the same app where you handle authentication, user records, and outbound email.
Start with the installation flow, then move through auth, forms, API wiring, and SMTP delivery using the same polished UI shell as the rest of the site.
In this section
Follow the same recovery flow across installation, forms, auth, API wiring, and email delivery.
Structure
Keep the existing docs routes, but present them in a cleaner shell that matches the rest of the product UI.
Install commands
Keep installation simple, then move directly into route protection and password recovery pages.
npm i albatroz
Albatroz is designed to drop into an existing React or Next.js codebase with a predictable forgot-password flow. Install it in the same app where you handle authentication, user records, and outbound email.
A minimal screen only needs an email input, lightweight validation, and the Albatroz forgot-password hook. This keeps the surface area small while still giving you a production-ready entry point.
Example
import React, { useState } from 'react';
import { useForgotPassword } from 'albatroz';
export default function ForgotPasswordScreen() {
const { loading, submitHandler } = useForgotPassword();
const [email, setEmail] = useState('');
const [errors, setErrors] = useState<{ email?: string }>({});
const validateEmail = (value: string) => {
const pattern = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i;
if (!value) return 'Please enter a valid email';
if (!pattern.test(value)) return 'Please use a valid email format';
return null;
};
const handleSubmit = (event: React.FormEvent) => {
event.preventDefault();
const emailError = validateEmail(email);
if (emailError) {
setErrors({ email: emailError });
return;
}
setErrors({});
submitHandler({ email });
};
return (
<form onSubmit={handleSubmit}>
<label htmlFor="email">Email</label>
<input
id="email"
type="email"
value={email}
onChange={(event) => setEmail(event.target.value)}
/>
{errors.email && <p>{errors.email}</p>}
<button disabled={loading}>
{loading ? 'Processing' : 'Send recovery email'}
</button>
</form>
);
}
The easiest way to keep the docs aligned with the codebase is to implement the recovery journey in the same order that users experience it.
Previous
Start at the top of the documentation flow.
Next
Auth