Member
Represent a member of organization.
Definition
| Property Name | Type | Required |
|---|---|---|
| user_id | string | YES |
| organization_id | string | YES |
| role | string | YES |
Auto-generated by better-auth
| Property Name | Type | Native Type (PostgreSQL) |
|---|---|---|
| id | string | text |
| created_at | string | timestampz |
Example
JSON
{
"id": "123",
"user_id": "1234",
"organization_id": "12345",
"role": "admin",
"created_at": "2026-10-02 21:27:00+07"
}
Important Notes
Case Style
Better Auth uses camelCase by default. To keep your database schema consistent in snake_case, add the following configuration:
const auth = betterAuth({
plugins: [
organization({
schema: {
member: {
fields: {
userId: "user_id",
organizationId: "organization_id",
createdAt: "created_at",
},
},
},
}),
],
});
Info
Type inference in your code will still use the original field names (e.g., member.createdAt, not member.created_at).