O3 Framework / setUserProperties
setUserProperties(
userUuid,userProperties,abortController?):Promise<SessionStore>
Defined in: packages/framework/esm-api/src/current-user.ts:387
Updates the user properties for a specific user. User properties are key-value pairs that store user-specific settings and preferences. After updating the properties on the server, the current user session is refetched to reflect the changes.
string
The UUID of the user whose properties should be updated.
An object containing the properties to set or update.
AbortController
Optional AbortController to allow cancellation of the request. If not provided, a new AbortController is created.
Promise<SessionStore>
A Promise that resolves with the updated SessionStore after refetching the current user.
import { getLoggedInUser, setUserProperties } from '@openmrs/esm-api';
const user = await getLoggedInUser();
await setUserProperties(user.uuid, {
defaultLocale: 'en_GB',
customSetting: 'value'
});