O3 Framework / getSessionLocation
getSessionLocation():
Promise<undefined|SessionLocation>
Defined in: packages/framework/esm-api/src/current-user.ts:325
Returns a Promise that resolves with the current session location, if one is set. The session location represents the physical location where the user is currently working (e.g., a clinic or ward).
Promise<undefined | SessionLocation>
A Promise that resolves with the SessionLocation object, or undefined
if no session location is set.
import { getSessionLocation } from '@openmrs/esm-api';
const location = await getSessionLocation();
if (location) {
console.log('Current location:', location.display);
}