SignIn Anonymous on Server
Is it possible? I dont see it on docs
Solution:Jump to solution
all authClient endpoints are exposed by auth.api and this can be called on the server
8 Replies
Hi, it’s possible https://www.better-auth.com/docs/plugins/anonymous
Anonymous | Better Auth
Anonymous plugin for Better Auth.
Its using authClient
const user = await authClient.signIn.anonymous()
Does it work on server?
yes its a possible
How tho
auth.ts
await auth.api.signInAnonymous()
try it
Solution
all authClient endpoints are exposed by auth.api and this can be called on the server
API | Better Auth
Better Auth API.
"Any endpoint added to Better Auth, whether from plugins or the core, will be accessible through the api object."