I'm developing multiple plugins for my project called Cosmos and have encountered an issue. When I implement custom endpoints in a plugin, they aren't accessible through either the auth.api or authClient interfaces. I reviewed the documentation and examined the built-in plugins within better-auth, but I haven't been able to determine if I'm missing something or if there's an actual issue with Better Auth itself.
To isolate the problem, I've created a minimal test project using only Drizzle with PGLite and Hono running on Bun. Additionally, I experienced a related issue when attempting to implement the example birthday plugin from the documentation, the type wasn't properly recognized by the authClient's signUp function. As a workaround, I added the birthday field to inferAdditionalFields.
// doesn't work at all // authClient.createInvitation(); // works but there is no type // auth.api.createInvitation();
// doesn't work at all // authClient.createInvitation(); // works but there is no type // auth.api.createInvitation();