Collection of convenient hooks for working with Ory Kratos, identity and user management system.
useFlow: This hook allows you to easily manage authentication flows in your React applications.useSession: Use this hook to access and manage user sessions with Ory Kratos.
flowType: login | registration | recovery | settings | verificationrenderkeys: input | a | img | text | script. Components are uncontrolled and submitted via form.
const { html, return_to } = useFlow({
flowType: 'login',
options: {
render: {
input: ({ meta, props }) => {
if (props.type === 'submit') {
return <Button {...props}>{meta.label?.text}</Button>;
}
return <input {...props} />;
},
a: () => {...},
img: () => {...},
text: () => {...},
script: () => {...},
},
},
})