Docs improvements #299

Closed
opened 2026-03-13 07:41:12 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @JosipPardon on GitHub (Nov 28, 2024).

Before everything, thanks for this great library!

  1. There is no place where all possible properties of certain object/function are listed with descriptions (something like API reference). It would be nice to have it.
  2. Sometimes client is used and sometimes authClient. It should be authClient always, to make things consistent and less confusing.
  3. Typing "createAuthClient" in search returns 0 results, despite it being mentioned all over the place
  4. Here and in "Create Sign in Box" demo on home page, it is suggested to put baseUrl:"localhost:3000" as argument in createAuthClient. This is not needed for most of the apps and just adds unnecessary complexity. It is not clearly stated that this is optional parameter and that everything will work fine without it (in most cases).
  5. It should be stated that library does not perform validation of user input. For example, user with empty string as email can be created. Developer should validate input by himself: password, email etc.
Originally created by @JosipPardon on GitHub (Nov 28, 2024). Before everything, thanks for this great library! 1. There is no place where all possible properties of certain object/function are listed with descriptions (something like API reference). It would be nice to have it. 2. Sometimes _client_ is used and sometimes _authClient_. It should be _authClient_ always, to make things consistent and less confusing. 3. Typing "createAuthClient" in search returns 0 results, despite it being mentioned all over the place 4. [Here](https://www.better-auth.com/docs/installation#create-client-instance) and in "Create Sign in Box" demo on home page, it is suggested to put `baseUrl:"localhost:3000"` as argument in _createAuthClient_. This is not needed for most of the apps and just adds unnecessary complexity. It is not clearly stated that this is optional parameter and that everything will work fine without it (in most cases). 5. It should be stated that library does not perform validation of user input. For example, user with empty string as email can be created. Developer should validate input by himself: password, email etc.
Author
Owner

@Bekacru commented on GitHub (Dec 1, 2024):

Hey thanks for the feedback.

  1. We used to have one, but since it changed frequently, we moved it to a type interface and linked the options type so people could refer to the JSDoc. Still, it’s a valid request—feel free to open an issue so we can track it.
  2. That’s a fair point. We’ve been standardizing on authClient, but there are still some missing instances. We’ll address those.
  3. That’s likely because it’s mostly referenced in code blocks. But, you can access the client docs under /concepts/client, and searching "client" should provide enough references.
  4. There are scenarios where baseURL is still necessary. For example, if BETTER_AUTH_URL isn’t in your environment, we can’t infer the auth URL during SSR. And even if BETTER_AUTH_URL is required, it won’t properly infer if you use a custom path rather than the default api/auth/**, which might confuse users if it doesn’t work. Plus, we don't assume you're using a meta framework always. You can have separate client/server architecture.
  5. Not sure where that came from, but we do validate user input. Emails are validated, and if there’s an endpoint that isn’t properly validating, it’s a bug. Feel free to report it as a separate issue.
@Bekacru commented on GitHub (Dec 1, 2024): Hey thanks for the feedback. 1. We used to have one, but since it changed frequently, we moved it to a type interface and linked the options type so people could refer to the JSDoc. Still, it’s a valid request—feel free to open an issue so we can track it. 2. That’s a fair point. We’ve been standardizing on `authClient`, but there are still some missing instances. We’ll address those. 3. That’s likely because it’s mostly referenced in code blocks. But, you can access the client docs under `/concepts/client`, and searching "client" should provide enough references. 4. There are scenarios where `baseURL` is still necessary. For example, if `BETTER_AUTH_URL` isn’t in your environment, we can’t infer the auth URL during SSR. And even if `BETTER_AUTH_URL` is required, it won’t properly infer if you use a custom path rather than the default `api/auth/**`, which might confuse users if it doesn’t work. Plus, we don't assume you're using a meta framework always. You can have separate client/server architecture. 5. Not sure where that came from, but we do validate user input. Emails are validated, and if there’s an endpoint that isn’t properly validating, it’s a bug. Feel free to report it as a separate issue.
Author
Owner

@Bekacru commented on GitHub (Dec 2, 2024):

#728 this should address your second suggestion

@Bekacru commented on GitHub (Dec 2, 2024): #728 this should address your second suggestion
Author
Owner

@JosipPardon commented on GitHub (Dec 3, 2024):

@Bekacru Thanks for responding fast.

I think you misunderstood my 4th suggestion.

I am saying that it would be great if it is stated that baseUrl is optional if the API base URL matches the frontend, as it is stated in next-auth migration guide, here.

This comment should be added to other places where authClient creation is described, like here and in Create sign in box demo at home page.

@JosipPardon commented on GitHub (Dec 3, 2024): @Bekacru Thanks for responding fast. I think you misunderstood my 4th suggestion. I am saying that it would be great if it is stated that baseUrl is _optional if the API base URL matches the frontend_, as it is stated in next-auth migration guide, [here](https://www.better-auth.com/docs/guides/next-auth-migration-guide#update-the-client). This comment should be added to other places where authClient creation is described, like [here](https://www.better-auth.com/docs/installation#create-client-instance) and in _Create sign in box_ demo at home page.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#299