Admin API tools (without authentication)

Hey guys, quick question i couldn't find the answer to in the docs: I want to get an instance of the admin client that doesn't require authentication, so I can have a CLI to manage users. I.e creating users / setting passwords etc. Or i just need access to the underlying logic that better-auth uses to CRUD users Any ideas on how to do that?
5 Replies
Ping
Ping6mo ago
There isn't a "native" way to do this, so we might need to find so me workarounds to achieve this. You might just need to make a temp account for the purpose of your CLI, and make that acc an admin.
Kwae (GK)
Kwae (GK)3mo ago
@Ping, I'm also interested in something like this. We have the need to manage things using automated background processes, meaning our system needs to have an internal way to interact with the various objects inside the better auth system.
Ping
Ping3mo ago
I'm sorry but admin plugin was built around the idea of an admin user, you'll need to make a work-around such as a temp admin user account which represents your CLI. If you want this as a feature please open a feature request in #feature-requests
kingitaj
kingitaj3mo ago
Are there any plans to support M2M tokens natively?
Ping
Ping3mo ago
Yes in the future, however there are no ETAs at this time.

Did you find this page helpful?