The user object is a fundamental component in Aikeedo themes, providing access to essential user information when a user is logged into their account. This object is globally accessible, allowing you to easily incorporate user-specific data and functionality into your theme.

Availability

The user object is available globally when a user is logged in. If no user is logged in, the object will be undefined. Always check for the existence of the user object before attempting to access its properties.

It’s a good practice to use conditional checks when working with the user object to ensure your theme functions correctly for both logged-in and guest users.

Properties

The user object contains the following properties:

id
string
required

A unique identifier for the user, always in UUID version 4 format (e.g., “01895d81-4963-71b4-b591-8404987d6954”).

role
enum
required

The user’s role in the system. Possible values are:

  • admin: Administrator role with full system access
  • user: Standard user role with limited permissions
email
string
required

The user’s email address.

first_name
string
required

The user’s first name.

last_name
string
required

The user’s last name.

language
string
required

The user’s preferred language code (e.g., “en-US”).

has_password
boolean
required

Indicates whether the user has set a password. Users who signed up using 3rd party services like Google will not have a password.

avatar
string
required

URL to the user’s avatar image.

created_at
number
required

Unix timestamp of when the user account was created.

updated_at
number|null
required

Unix timestamp of the last update to the user account. While this field always exists, its value may be null if the user account has never been updated.

is_email_verified
boolean
required

Indicates whether the user’s email has been verified.

api_key
string
required

The user’s API key (partially masked for security).

affiliate
Affilaite
required

The user’s affiliate object. See Affiliate Object for more details on the properties of this object.

workspace
Workspace
required

The user’s active workspace object. See Workspace Object for more details on the properties of this object.

workspaces
array<Workspace>
required

An array of workspace objects that the user is a member of, excluding workspaces owned by the user. Each object in this array represents a workspace where the user has membership but not ownership. See Workspace Object for more details on the properties of these objects.

owned_workspaces
array<Workspace>
required

An array of workspace objects that the user owns. See Workspace Object for more details on the properties of these objects.