Skip to main content
The User entity exists in every Base44 project by default and stores information about your app’s users. You can add fields to store additional user data, then use those fields in security rules to control data access or in your app to personalize the experience.

Built-in fields

Every User entity includes a set of built-in fields by default.
FieldTypeDescription
full_namestringUser’s display name
emailstringUser’s email address
rolestringEither admin or user
The User entity also has the general built-in fields that exist on all entities , such as id, and created_date. These fields are managed by the system and can’t be redefined in your schema.

Custom fields

To add custom fields, define a User schema containing only your additional fields. Trying to redefine any built-in fields will cause a validation error. Create a User.json or User.jsonc file in your project’s entities directory. By default this is base44/entities/, but you can customize the path in your project configuration.
entities/User.json
{
  "type": "object",
  "properties": {
    "company": { "type": "string" },
    "phone": { "type": "string" },
    "job_title": { "type": "string" },
    "bio": { 
      "type": "string",
      "maxLength": 500
    }
  },
  "required": ["company"]
}
Then push your entities to Base44 using entities push or deploy.

Complete example

Here’s a complete User schema with various field types:
{
  "type": "object",
  "properties": {
    "company": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "job_title": {
      "type": "string",
      "maxLength": 100
    },
    "bio": {
      "type": "string",
      "maxLength": 500
    },
    "website": {
      "type": "string",
      "format": "uri"
    },
    "preferences": {
      "type": "object",
      "properties": {
        "theme": {
          "type": "string",
          "enum": ["light", "dark"],
          "default": "light"
        },
        "notifications": {
          "type": "boolean",
          "default": true
        }
      }
    }
  },
  "required": ["company"]
}

Use your fields

Once you’ve defined and pushed your User schema, you can reference your fields in security rules and access them in your app code.

In security rules

You can use user fields to control access to other entities. For example, you might restrict users to only see records that belong to their company. To reference user fields in security rules, use the {{user.data.*}} template syntax:
{
  "rls": {
    "read": {"data.company": "{{user.data.company}}"},
    "update": {"data.company": "{{user.data.company}}"}
  }
}
This rule ensures users can only read and update records where the record’s company field matches their own.

In code

Access user fields through the SDK:
// Get current user's fields
const currentUser = await base44.auth.me();
console.log(currentUser.company); // "Acme Inc"

// Update current user's fields
await base44.auth.updateMe({
  phone: "+1-555-0123",
  job_title: "Senior Developer"
});

// List all users with service role (backend functions only)
const allUsers = await base44.asServiceRole.entities.User.list();
This example uses a base44 client. See Setting up the client for setup instructions.

See also