How do I access the type of the value returned by getInvitation?
It's common in Better Auth to use
authClient
to query information - for example getInvitation
How do I access the type of the value returned by getInvitation
? Specifically I am interested in the data
I tried ReturnType
but it returns any
:
Solution:Jump to solution
Ah OK - I need to use
$Infer
with a type assertion
```ts
type Invitation = typeof authClient.$Infer.Invitation
...2 Replies
Solution
Ah OK - I need to use
$Infer
with a type assertion
@Ping I noticed the
$.Infer.Invitation
type is missing organizationName, organizationSlug, inviterEmail, and teamId.