[GH-ISSUE #379] Rename baseUrl for clarity #8244

Closed
opened 2026-04-13 03:20:13 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @luksch42 on GitHub (Oct 31, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/379

I'd like to propose renaming the baseUrl prop used during initialization. The current naming can be confusing in environments like Expo or Next.js applications that interact with an external backend where Better Auth is located.

Before we reach the 1.0 release, I believe renaming this prop will enhance clarity and improve the developer experience across different frameworks and environments.

apiBaseUrl could be a good replacement.

I'm willing to open a PR to implement this change. Please let me know your thoughts or if there are any preferred naming conventions we should consider.

Originally created by @luksch42 on GitHub (Oct 31, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/379 I'd like to propose renaming the `baseUrl` prop used during initialization. The current naming can be confusing in environments like Expo or Next.js applications that interact with an external backend where Better Auth is located. Before we reach the 1.0 release, I believe renaming this prop will enhance clarity and improve the developer experience across different frameworks and environments. apiBaseUrl could be a good replacement. I'm willing to open a PR to implement this change. Please let me know your thoughts or if there are any preferred naming conventions we should consider.
GiteaMirror added the locked label 2026-04-13 03:20:13 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 31, 2024):

Fair point. It actually started as apiURL, but I felt that baseURL was a clear and general choice to have on both ends. Tho, I can see how it could be confusing if you have a server instance on a different (sub)domain and aren't sure whether to set the frontend or backend URL. That said, I think it's not a common case, and having a standard baseURL for both makes more sense in my opinion. And the docs can help with the confusion.

And maybe even to make it clearer, we could add an error message if the API returns a 404, something like "Make sure this is your API URL" If you're up for it, feel free to open a PR.

<!-- gh-comment-id:2450690477 --> @Bekacru commented on GitHub (Oct 31, 2024): Fair point. It actually started as `apiURL`, but I felt that baseURL was a clear and general choice to have on both ends. Tho, I can see how it could be confusing if you have a server instance on a different (sub)domain and aren't sure whether to set the frontend or backend URL. That said, I think it's not a common case, and having a standard baseURL for both makes more sense in my opinion. And the docs can help with the confusion. And maybe even to make it clearer, we could add an error message if the API returns a 404, something like "Make sure this is your API URL" If you're up for it, feel free to open a PR.
Author
Owner

@Bekacru commented on GitHub (Nov 17, 2024):

not planned

<!-- gh-comment-id:2480998355 --> @Bekacru commented on GitHub (Nov 17, 2024): not planned
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8244