DocsDataData ModelMember

Represent a member of organization.

Definition

Property NameTypeRequired
user_idstringYES
organization_idstringYES
rolestringYES

Auto-generated by better-auth

Property NameTypeNative Type (PostgreSQL)
idstringtext
created_atstringtimestampz

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).

Built with LogoFlowershow