Kratos stores a user profile with custom traits and metadata.
To fetch the user's profile:
final profileResult = await client.getSettingsFlow();
This returns profile data including:
traits
- Map of custom traitsflowId
- Settings flow IDuserId
- User ID
To update the user's traits:
Pass the list of trait names and values to update.
Use flowID from getSettingsFlow
final traits = [
ProfileTrait(name: 'name', value: 'Jan'),
// other traits
];
final result = await client.updateTraits(
traits: traits,
flowId: profile.flowId,
);
To change the user's password:
Use flowID from getSettingsFlow
final result = await client.updatePassword(
password: newPassword,
flowId: flowId,
);