K
Kinde•8mo ago
MrGreyKnight

Updating custom properties

Is there any additional documentation for than this section for using the management api through the nextjs-sdk (app router)? https://kinde.com/docs/developer-tools/nextjs-sdk/#kinde-management-api Just looking at it and can see additional methods, for example, client.usersApi.updateUserProperties but cannot seem to find any docs for the methods.
Kinde Docs
NextJS App Router SDK - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
5 Replies
MrGreyKnight
MrGreyKnightOP•8mo ago
I initially assumed that it would match the api docs directly but the keys don't match according to the typescript inference. https://kinde.com/api/docs/#update-property-value-2
viv (kinde)
viv (kinde)•8mo ago
Hi @MrGreyKnight - there are a few additional notes here (https://kinde.com/docs/developer-tools/nextjs-sdk/#kinde-management-api) for using the management API, let me know if this helps / if there's something more specific you were looking for? Would you be able to clarify which keys in the typescript interface aren't matching in PATCH /api/v1/users/{user_id}/properties/{property_key}? Thank you 😀 !
Kinde Docs
NextJS App Router SDK - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
viv (kinde)
viv (kinde)•8mo ago
Just FYI - sorry for the trouble, we're also updating the properties API (there was a mismatch of PUT / PATCH endpoints) so that may also resolve any issues - it's currently in review but should be approved & merged shortly. Cheers!
Aboud
Aboud•8mo ago
viv, quick follow-up... it seems that with custom properties, when a user is already logged in, and then the value of a custom property is updated in the console or via management api, and the user browser refreshes or calls the NextJS getAccessToken function, the custom property does not show the updated value. Instead, the user has to log back out (LogoutLink), and log in again, in order to see the updated value. Is there a fix for this?
Oli - Kinde
Oli - Kinde•8mo ago
Hey @Aboud, Great question in the latest versions of the NextJS SDK (v2.2.0+) you can use the getKindeServerSession().refreshTokens() method to refresh claims. FYI, the API endpoints for setting property values is now updated to reflect the correct API requests, see the following API endpoints: User - https://kinde.com/api/docs/#update-property-value - https://kinde.com/api/docs/#update-property-values Organization: - https://kinde.com/api/docs/#update-organization-property-value - https://kinde.com/api/docs/#update-organization-property-values
Want results from more Discord servers?
Add your server