Render identity details
Profile pages
Kinde · Module
getUserProfile asynchronously returns the profile of the currently logged-in user in Kinde’s React SDK. Obtain it from useKindeAuth and call it without arguments.
In the Kinde React SDK, obtain getUserProfile from useKindeAuth and await it to retrieve the currently logged-in user’s profile. The returned object exposes identity and contact fields such as the Kinde ID, names, email, and optional profile picture.
const { getUserProfile } = useKindeAuth();
const profile = await getUserProfile();A profile object for the currently logged-in user, including id, givenName, familyName, email, and an optional picture.
import { useKindeAuth } from '@kinde-oss/kinde-auth-react';
export default function Profile() {
const { getUserProfile } = useKindeAuth();
async function loadProfile() {
const profile = await getUserProfile();
console.log(profile);
}
return <button onClick={loadProfile}>Get profile</button>;
}This component obtains the profile loader from the Kinde React hook and invokes it asynchronously when the button is clicked.
Profile pages
Account settings
Authenticated dashboards
getUserProfile is obtained from useKindeAuth and called as an asynchronous function. Awaiting it returns the profile object for the currently logged-in user.
Follow-up: How would you display the result safely? Store the resolved value in component state and guard optional fields before rendering them.
The profile includes the user’s Kinde ID, given name, family name, email, and picture when available. These values can be rendered from the resolved profile object.
Follow-up: Which profile field may be unavailable? The picture is optional, so the UI should tolerate its absence.
Destructure getUserProfile from useKindeAuth, then invoke it from an event handler or another appropriate asynchronous flow. The documented usage awaits the result before logging it.
Follow-up: Why avoid calling it directly during every render? Repeated render-time calls can trigger unnecessary asynchronous work; use an event or controlled effect instead.
useKindeAuthuseridgivenNamefamilyNameemailpicture