Missing functions in organization plugin: getActiveOrganization and listOrganziations.

getActiveOrganization is not implemented in the plugin. I can find listOrganizations in the sourcecode, bud when I do auth.api.listOrganizations (server side) it sells me the property does not exist on type 'InferApi'. Any advice here? My plugins auth.ts: plugins: [ openAPI(), twoFactor(), passkey(), organization(), reactStartCookies() ] Client: import { adminClient, emailOTPClient, magicLinkClient, multiSessionClient, organizationClient, passkeyClient, twoFactorClient, } from 'better-auth/client/plugins'; import { createAuthClient } from 'better-auth/react'; import { env } from '@/lib/env.client'; import { ac, admin as adminRole, superadmin as superAdminRole, user as userRole, } from './permissions'; export const authClient = createAuthClient({ baseURL: env.VITE_SERVER_URL, plugins: [ twoFactorClient(), passkeyClient(), adminClient({ ac, roles: { user: userRole, admin: adminRole, superadmin: superAdminRole, }, }), organizationClient(), emailOTPClient(), magicLinkClient(), multiSessionClient(), ], }); export type AuthClient = ReturnType<typeof createAuthClient>;
5 Replies
Nicolay
NicolayOP3mo ago
I am on latest.
Ping
Ping3mo ago
Are you in a monorepo?
Nicolay
NicolayOP3mo ago
Yes but with no hoist.
Ping
Ping3mo ago
Can you show me your full auth config? and the tsconfig of that auth project
DIO
DIO3mo ago
Not to hijack the issue, but I've got a very similar issue, and I suspect it's the same issue. In my case, I think it was caused by adding "exactOptionalPropertyTypes": true to tsconfig. I'm not too sure why I added this property, but removing it resolved my issue which matches OP's issue.

Did you find this page helpful?