Seeing several type errors / breaking changes after updating 1.2.5 -> 1.2.8
Running into some issues after upgrading better-auth:
- fetchOptions is no longer accepted in auth.api calls
- query now appears to be required for auth.api
- authClient.useSession → now needs to be accessed via createAuthClient().useSession()
- Can’t access methods like authClient.organization.cancelInvitation or inviteMember
Not sure what the recommended migration path is - is there an upgrade guide available? Also wondering if there are any plans to adopt semver for better-auth?
14 Replies
fetchOptions is a authClient thing
query being required depends on the endpoint's method, if the method is using
GET
then it's query
, otherwise if it's POST
then it's body
authClient.useSession should still work.
the authClient.organization.cancelInvitation still exists:
hmm
I'm getting a type error with authClient.useSession where useSession returns "never" for data:
and I'm getting the following type error for
cancelInvitation
Can you show me your auth client config?
yes - can I dm you?
Sure.
I mean the auth client config, not the auth config.
@kristen If you removed all of the client plugins, does the types fix itself for the
useSession
data?ah, I created my own custom plugin (workspaceClient). when I removed it and all of its logic, then my app was able to build. Is there an upgrade path for a custom plugin?
No, most cases you would get type errors if something changed
hmm, have any ideas why it might be affecting the auth client's useSession type?
Can i see your code?