Multiple apps sharing the same database using Better Auth

Hello!

You guys are doing some awesome stuff with this framework.

I am wondering if it is possible to have the following setup:

  • Postgres database
  • Nextjs app
  • Honojs api
I want to share the same database between the nextjs app and honojs backend api using Better Auth.

For example I would setup a Better Auth server on both nextjs app and honojs, configuring the same database. I would share the same Auth secret.

Alternatively I would manually verify the session on the honojs backend api directly in the database rather than using Better Auth. Do you have any recommendations for solving this problem?

I need to have a backend api in addition to a nextjs app as I will be managing large numbers of web socket connections. The websockets will be from expo of that makes any difference.

Any thoughts are appreciated!
Thanks!
Was this page helpful?