infer additional organization field on nextjs doesnt work for hooks?

my config :
// CLIENT
import { createAuthClient } from "better-auth/react";
import {
inferOrgAdditionalFields,
organizationClient,
} from "better-auth/client/plugins";
import type { auth } from "./server";

export const authClient = createAuthClient({
plugins: [
organizationClient({
schema: inferOrgAdditionalFields<typeof auth>(),
}),
],
});
// CLIENT
import { createAuthClient } from "better-auth/react";
import {
inferOrgAdditionalFields,
organizationClient,
} from "better-auth/client/plugins";
import type { auth } from "./server";

export const authClient = createAuthClient({
plugins: [
organizationClient({
schema: inferOrgAdditionalFields<typeof auth>(),
}),
],
});
//SERVER
import { organization } from "better-auth/plugins/organization";

organization({
schema: {
organization: {
additionalFields: {
description: {
type: "string",
input: true,
required: false,
},
},
},
},
});
//SERVER
import { organization } from "better-auth/plugins/organization";

organization({
schema: {
organization: {
additionalFields: {
description: {
type: "string",
input: true,
required: false,
},
},
},
},
});
// this hooks doesnt infer
const { data: organizations } = authClient.useListOrganizations();
// this hooks doesnt infer
const { data: organizations } = authClient.useListOrganizations();
No description
3 Replies
dun
dunOP7d ago
"better-auth": "^1.3.27",
"better-auth": "^1.3.27",
@admin this is an error / expected and will be an update soon to fix this? i need to do this for every hooks?
const org = authClient.useActiveOrganization();
// @ts-expect-error <- THIS
const orgDesc = org?.description;
const org = authClient.useActiveOrganization();
// @ts-expect-error <- THIS
const orgDesc = org?.description;
Ping
Ping7d ago
yeah it's an existing issue, it's being solved.

Did you find this page helpful?