useLumioIdentity
Read which Lumio account the install belongs to.
Signature
const identity = useLumioIdentity();
Parameters
This hook takes no parameters.
Return value
| Property | Type | Description |
|---|---|---|
accountId | string | null | Lumio account that owns this installation. Set on every surface |
userId | string | null | Reserved for the signed-in dashboard user. No Lumio host sends it today, so it is null |
role | string | null | Reserved for that user's account role. No Lumio host sends it today, so it is null |
Example
import { useLumioIdentity, Text } from "@zaflun/lumio-sdk";
function AccountBadge() {
const { accountId } = useLumioIdentity();
return <Text content={`Account ${accountId ?? "unknown"}`} variant="muted" />;
}
Notes
- The values come from
lifecycle.init, which the host sends before your bundle runs, so the first render already has them. - No surface carries a viewer identity. Lumio has no viewer page; a chat sender is known only inside a bot-module handler as
ctx.user(see Viewer Input). - Do not use
userIdorrolefor access control. Who may edit an install is decided by Lumio's permissions before your editor surface is shown; server functions check the caller themselves. useExtensionContext()returns the matching install fields from the samelifecycle.init:{ extensionId, target, overlayId }, whereoverlayIdis the install id andtargetis"editor"or"layer".