Set the correct Typescript type when using plugins

I'm using the admin and organization plugins from
better-auth/plugins
.

I'm explicitly typing by
betterAuth
instance as
ReturnType<typeof betterAuth>;
, but when I try to access one of the API provided functions, e.g. betterAuth.api.listUsers, TS warns me it doesn't exist.

What is the correct typing for my
betterAuth
instance?
Was this page helpful?