BrowserClient.getUser returns Promise<string>
Hi, I'm using kinde-typescript-sdk 2.3.2. It was really easy to integrate Kinde, registration and login are working, but when I call browserclient.getUser it seems to return a Promise<string> instead of Promise<UserType>. I kind of hacked around it but it's not pretty π browserClient was created by createKindeBrowserClient()
2 Replies
Hey @Baloo,
It seems like you're trying to get user details using the
getUser
method. However, in the Kinde TypeScript SDK, the method to get user details is getUserProfile()
, not getUser()
. See the following doc: https://kinde.com/docs/developer-tools/typescript-sdk/#view-user-profile
Here's how you can use it:
This will return a Promise that resolves to an object with user details, like this:
I hope this helps! Let me know if you have any other questions. πKinde Docs
TypeScript SDK - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
Thanks! getUserProfile is working!
May I suggest removing getUser from the type createKindeBrowserClient returns?