Store new fields for the users

I’m exploring how to extend the user model via plugins, and I’m specifically trying to figure out how to store persistent custom data on a user’s account.

I want to add a new field to each user — for example, something like:
internal_system_id: “ABC123XYZ”

This value needs to be:

  • Persisted in the database
  • Accessible later in other plugin actions
  • Usable for internal queries or third-party integrations
  • Attached to a user in a stable, non-volatile way

From my understanding, there is a meta field in the system but I am not sure how I can customize that.

To store a persistent custom field like an internal_system_id on a user and use it inside plugins, you can use the user meta system in HollaEx.

Enable the Meta Field in the Exchange Config (UI)

First, you need to define the meta key so it’s supported in the operator panel:

  1. Go to Users in the admin UI.
  2. Select any user.
  3. Go to the Meta tab.
  4. Click “Configure Meta”.
  5. Add the meta key you want, e.g.: internal_system_id

Once this is configured, you can manually set internal_system_id for users from the admin UI if needed.

If you want to do this programmatically from outside (e.g., from a backend service), you can use the Admin APIs, for example via hollaex-node-lib with admin keys and updateExchangeUser.

Example:

// Pseudo code using hollaex-node-lib

await updateExchangeUser(userId, {
  meta: {
    internal_system_id: 'ABC123XYZ'
  }
});

This will persist the value in the user’s meta and can be used for other operations later.

If you are doing this inside a plugin, you can update the user meta directly using toolsLib.user.updateUserMeta.

Example:

async function updateMeta() {
  const userId = 123; // HollaEx user ID

  const metaUpdate = {
    internal_system_id: 'ABC123XYZ'
  };

  const auditInfo = {
    userEmail: '[email protected]',
    sessionId: 'sess-123',
    apiPath: '/admin/user/meta',
    method: 'put'
  };

  const user = await toolsLib.user.updateUserMeta(
    userId,
    metaUpdate,
    { overwrite: false }, // set true if you want to overwrite existing meta fields
    auditInfo
  );

  console.log(user.meta); // will include internal_system_id
}
  • overwrite: false will merge the provided meta fields with existing ones, instead of wiping them.
  • auditInfo is used for logging/auditing so the system knows who performed the change and via which path.