Closed ishaangandhi closed 5 months ago
Hello @ishaangandhi
Those 2 types are not the same. The reference docs https://clerk.com/docs/references/javascript/user/user are related to our @clerk/clerk-js
package and the window.Clerk.user
value or the useUser()
return value. This paragraph in the docs link is meant to distinguish that it's used in @clerk/clerk-js
The ClerkJS SDK provides some helper methods on the User object to help retrieve and update user information and authentication status.
The @clerk/backend
type for User
is a bit different since it may contain data that should not be available to the browser. Sometimes there are some inconsistencies due to human error, but sometimes they are intended.
Thank you for the feedback, we will take a better look at this and check if we should update the type or not.
I mean, the Backend docs say the same thing:
createdAt Date Date when the user was first created.
@ishaangandhi oops 😓 . i didn't see that. That's definitely something we should update.
Preliminary Checks
[X] I have reviewed the documentation: https://clerk.com/docs
[X] I have searched for existing issues: https://github.com/clerk/javascript/issues
[X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
https://github.com/ignore-me
Publishable key
pk_ignore_me
Description
https://clerk.com/docs/references/javascript/user/user says a
user.createdAt
is aDate
, but innode_modules/.pnpm/@clerk+backend@0.38.3_react@18.2.0/node_modules/@clerk/backend/dist/types/api/resources/User.d.ts
, it saysUser.createdAt
is anumber
:I'm not sure which one is right.
Environment