Provide a standard sign-out link in an account menu.
Authenticated navigation
Kinde · Component
LogoutLink is Kinde’s React component for ending the current user session. Render it with child content such as a “Sign out” label.
LogoutLink is a React component from Kinde’s React SDK that initiates the sign-out flow when activated. Place it in the authenticated interface and provide link content as its children; the configured logout redirect determines where the user goes afterward.
<LogoutLink>Sign out</LogoutLink>| Name | Type | Description |
|---|---|---|
children | ReactNode | ReactNode rendered as the link’s content or label. |
A React link component that starts the Kinde logout flow when activated.
import { LogoutLink } from '@kinde-oss/kinde-auth-react/components';
export default function AccountActions() {
return <LogoutLink>Sign out</LogoutLink>;
}Render the component where users should be able to end their current Kinde session.
Authenticated navigation
User profile controls
Shared application shell
Import LogoutLink from the React SDK’s components entry point and render it with child content, such as “Sign out.” Activating the component starts Kinde’s logout flow.
Follow-up: How would you implement logout with custom behavior instead? Use useKindeAuth to obtain logout and call it from a button handler.
The component is intended to end the current Kinde session. It is the link-based alternative to calling the logout method returned by useKindeAuth.
Follow-up: How can logout affect every session? The related logout method accepts allSessions: true.
After sign-out, Kinde redirects the user according to the logoutUri configured on KindeProvider. That setting is a string and is optional.
Follow-up: How can one logout action override the configured destination? Call logout with a redirectUrl option instead of using the link component.
KindeProvideruseKindeAuthlogoutlogoutUri