Client Components
UserButton
The UserButton is a ready-to-use UI component that manages the user's profile display and provides a secure path for signing out.
Usage
Ideally placed in your application header or sidebar for easy access:
terminal
import { UserButton } from "@ezz-auth/next";
export default function Navbar() {
return (
<header className="flex justify-between p-4 bg-black border-b border-zinc-800">
<Logo />
<UserButton />
</header>
);
}Component Behavior
Profile Identity
Automatically displays the user's avatar, name, and email once authenticated.
Session Management
Provides an integrated, secure logout trigger that invalidates the session server-side.
Secure Context
Built-in protection ensures the dropdown only renders when a valid session is active.