activeOrganizationId missing from Session type in TypeScript
When using better-auth with TypeScript, the Session type does not include the activeOrganizationId property, even when using the organization plugin. This causes type errors when trying to access authSession.session.activeOrganizationId after calling auth.api.getSession().
Steps to Reproduce:
Initialize better-auth with the organization plugin.
Call const authSession = await auth.api.getSession({ headers }).
Try to access authSession.session.activeOrganizationId in TypeScript.
Expected Behavior:
The Session type should include activeOrganizationId as an optional property when the organization plugin is enabled.
Actual Behavior:
TypeScript throws an error:
Property 'activeOrganizationId' does not exist on type ...
0 Replies