User
Represent the application user.
Definition
| Property Name | Type | Required |
|---|---|---|
| full_name | string | YES |
| first_name | string | YES |
| middle_name | string | NO |
| last_name | string | YES |
| salutation | string | NO |
| title | string | NO |
| string | YES | |
| email_verified | boolean | YES |
| image | string | NO |
| statuses | CodedConcept[] | YES |
| identifiers | CodedConcept[] | YES |
| demographic.sex | string | YES |
| demographic.religion | string | YES |
| demographic.ethcnicity | string | NO |
| demographic.marital_status | string | YES |
| demographic.date_of_birth | string | YES |
| demographic.place_of_birth | string | NO |
| contacts | CodedConcept[] | NO |
| settings_id | string | YES |
Auto-generated by better-auth |
| Property Name | Type | Native Type (PostgreSQL) |
|---|---|---|
| id | string | text |
| created_at | string | timestampz |
| updated_at | string | timestampz |
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).