DocsDataData ModelUser

Represent the application user.

Definition

Property NameTypeRequired
full_namestringYES
first_namestringYES
middle_namestringNO
last_namestringYES
salutationstringNO
titlestringNO
emailstringYES
email_verifiedbooleanYES
imagestringNO
statusesCodedConcept[]YES
identifiersCodedConcept[]YES
demographic.sexstringYES
demographic.religionstringYES
demographic.ethcnicitystringNO
demographic.marital_statusstringYES
demographic.date_of_birthstringYES
demographic.place_of_birthstringNO
contactsCodedConcept[]NO
settings_idstringYES
Auto-generated by better-auth
Property NameTypeNative Type (PostgreSQL)
idstringtext
created_atstringtimestampz
updated_atstringtimestampz

Example

JSON

{
  "id": "123",
  "full_name": "Dr. Cynthia Veronica Manurung Sp.PD",
  "first_name": "Cynthia",
  "middle_name": "Veronica",
  "last_name": "Manurung",
  "salutation": "Dr.",
  "title": "Sp.PD",
  "email": "cynthiavm@mail.com",
  "email_verified": true,
  "image": "https://image.url.com",
  "statuses": [
    {
      "system": "crn:status:system",
      "value": "active",
      "display": "Active"
    }
  ],
  "identifiers": [
    {
      "system": "crn:identifier:nik",
      "value": "23442771929004"
    }
  ],
  "demographic": {
    "sex": {
      "system": "crn:sex",
      "value": "f",
      "display": "Female"
    },
    "religion": {
      "system": "crn:believes",
      "value": "protestantism",
      "display": "Protestant"
    },
    "ethnicity": "Batak",
    "marital_status": {
      "system": "crn:status:marital",
      "value": "married",
      "display": "Married"
    },
    "date_of_birth": "21-06-1984",
    "place_of_birth": "Jakarta"
  },
  "contacts": [
    {
      "system": "crn:contact:phone",
      "value": "02188521488"
    },
    {
      "system": "crn:contact:mobile",
      "value": "08124552757011"
    },
    {
      "system": "crn:contact:email",
      "value": "cynthiavm@mail.com"
    }
  ],
  "settings_id": "123",
  "created_at": "2026-10-02 21:27:00+07",
  "updated_at": "2026-10-02 21:27:00+07"
}

Important Notes

Additional Field

Better Auth core user schema (as of version 1.7.7) only consist of id, name, email, emailVerified, image, createdAt, updatedAt. The other property defined above are additional field you must add in your better auth configuration like below

const auth = betterAuth({
  user: {
    additionalFields: {
      first_name: {
        type: "string",
        required: true,
        input: true,
      },
      middle_name: {
        type: "string",
        required: false,
        input: true,
      },
      last_name: {
        type: "string",
        required: true,
        input: true,
      },
      salutation: {
        type: "string",
        required: false,
        input: true,
      },
      title: {
        type: "string",
        required: false,
        input: true,
      },
      statuses: {
        type: "string[]",
        required: true,
        defaultValue: JSON.stringify([
          {
            system: "crn:status:system",
            value: "active",
            display: "Active",
          },
        ]),
        input: true,
      },
      identifiers: {
        type: "string[]",
        required: true,
        defaultValue: "[]",
        input: true,
      },
      demographic: {
        type: "string",
        required: true,
        input: true,
      },
      contacts: {
        type: "string[]",
        required: true,
        defaultValue: "[]",
        input: true,
      },
      settings_id: {
        type: "string",
        required: true,
        input: false,
      },
    },
  },
});

Read here to learn more on how to extend better auth core schema.

Case Style

Better Auth uses camelCase by default. To keep your database schema consistent in snake_case, add the following configuration:

const auth = betterAuth({
  user: {
    field: {
      name: "full_name",
      emailVerified: "email_verified",
      createdAt: "created_at",
      updatedAt: "updated_at",
    },
  },
});

Info

Type inference in your code will still use the original field names (e.g., user.name, not user.full_name).

Built with LogoFlowershow