Adding custom properties to Organization members
Hey,
The title says it all 😛 I would like to add custom properties to the members of an organization but I don't see any docs on it.
I tried adding it to the table and hope the auth.api.getActiveMember() will pick it up but no luck 😦
Is this possible, if so, how?
Thanks 🙂
6 Replies
Hi @Kasszz any update on this?
i am also trying to add custom/additional fields to members. i am using organizations plugin. could someone please guide me on this?
i have defined the schema in Prisma manually, but the values are not being added
here is my code.
can you show me how you are passing the additional fields
The docs has examples of adding new fields to the user schema. But it doesn't give suggestions for adding new fields to organization members schema
So i modified the schema in Prisma directly
Hey, not gotten any further yet ( busy at work ^^ ). But yea like @Megamind said, you can add them to your Prisma or in my case Drizzle schemas. But better-auth then has no idea about it and doesn't retrieve it on getActiveMember()
It is extendible I mean the additionalField can also work with organization table it is not limited for a specific table. you should tweak some stuff manually for that tho
First add it there and try to infer the type by using the link above and try to mutate data based on that .
Hey, I'm trying to get it to work but when adding a "test" column on the members table that is non NULL. The code breaks when I'm trying to make an organisation with:
Is there an example that I could use because I feel like I'm just being a noob 😛