Welcome to the Kinde community

Updated 8 months ago

NextJS: getOrganization and organization in useKindeBrowserClient() is incorrectly typed

Hi all,
Using the latest version of the NextJS App Router SDK

useKindeBrowserClient().organization and useKindeBrowserClient().getOrganization() is typed as KindeOrganization, which should be an object with an orgCode value. In testing, this doesn't appear to be the case - instead the results of this is the orgCode as a string. I spent a little while chasing my tail to figure out why the orgCode was undefined on the object only to realize it's because the object wasn't an object... but a string πŸ˜†
Y
D
2 comments
A followup to this: getOrganization() is correctly typed and returned as a KindeOrganization object on getKindeServerSession(), it just appears to be the browser client.
Thanks for raising this, we will get these checked
Add a reply
Sign up and join the conversation on Discord