Skip to main content

useLumioIdentity

Read which Lumio account the install belongs to.

Signature​

const identity = useLumioIdentity();

Parameters​

This hook takes no parameters.

Return value​

PropertyTypeDescription
accountIdstring | nullLumio account that owns this installation. Set on every surface
userIdstring | nullReserved for the signed-in dashboard user. No Lumio host sends it today, so it is null
rolestring | nullReserved 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 userId or role for 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 same lifecycle.init: { extensionId, target, overlayId }, where overlayId is the install id and target is "editor" or "layer".