Arcane OS Docs Development only

Reference

Arcane.user.current()

Gets the privacy-minimized bound identity. Microsoft NT/Linux return a host-account; Android returns an anonymous local-session with null account identifiers. Requires identity.read.

  • Reference

This focused page is derived from the mechanically checked full member inventory.

Syntax

Arcane.user.current()

Parameters

None

Return value

Promise<{identityKind, username, accountName, displayName, source}>

Description

Gets the privacy-minimized bound identity. Microsoft NT/Linux return a host-account; Android returns an anonymous local-session with null account identifiers. Requires identity.read.

Overview

Arcane.user.current() returns the privacy-minimized identity bound to the current host session. It requires identity.read and is available on Core and Android. It is a repeatable read with no event or side effect. It is not an authentication token and cannot select another user.

Result and platform differences

The exact result is {identityKind, username, accountName, displayName, source}. Microsoft NT and Linux return identityKind: "host-account", nonempty username, accountName, and displayName, and source set to "windows" or "linux".

Android returns identityKind: "local-session", username: null, accountName: null, a bounded display name, and source: "android". Do not derive or synthesize an Android operating-system account identifier.

Errors and recovery

METHOD_NOT_ALLOWED or ANDROID_CAPABILITY_DENIED means identity.read is not granted. METHOD_CONTRACT_OUTPUT_INVALID means the identity violated the privacy-minimized contract; treat identity as unavailable and repair the host.

Example

const identity = await Arcane.user.current();
const label = identity.identityKind === 'host-account'
    ? identity.displayName
    : 'Local Android session';

console.log(label, identity.source);

Reference group

Platform, installation, users, and system

Repository and reviewed source access