I'm currently working on a project where the better auth instance can change on the fly. I'd like the ability to be able to pass in a better-auth instance provider instead of the better-auth instance itself. I've looked at the code and I've pulled it into my personal repo and modified it to work this way, it did take some doing but I got it to work in the end.
Hooks were fine to keep as they are since they are application level code anyway, but it's the plugins and config variables I wanted to change on the fly.
For reference, I added the ability to provide a method for returning a better auth instance here and modified some of the code elsewhere to handle this change.
I'm currently working on a project where the better auth instance can change on the fly. I'd like the ability to be able to pass in a better-auth instance provider instead of the better-auth instance itself. I've looked at the code and I've pulled it into my personal repo and modified it to work this way, it did take some doing but I got it to work in the end.
Hooks were fine to keep as they are since they are application level code anyway, but it's the plugins and config variables I wanted to change on the fly.
For reference, I added the ability to provide a method for returning a better auth instance here and modified some of the code elsewhere to handle this change.