[GH-ISSUE #4365] docs: llms.txt and copied markdown is missing server side code #9914

Closed
opened 2026-04-13 05:43:49 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @FabianHertwig on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4365

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

or open the https://www.better-auth.com/llms.txt

Current vs. Expected behavior

For code examples that have a client and server side, the server side is missing. I would expect it to be also included.

E.g. in the docs for https://www.better-auth.com/docs/plugins/magic-link we can see these two examples:

Docs client side

const { data, error } = await authClient.signIn.magicLink({
    email: "user@email.com", // required
    name: "my-name",
    callbackURL: "/dashboard",
    newUserCallbackURL: "/welcome",
    errorCallbackURL: "/error",
});

Docs server side

const data = await auth.api.signInMagicLink({
    body: {
        email: "user@email.com", // required
        name: "my-name",
        callbackURL: "/dashboard",
        newUserCallbackURL: "/welcome",
        errorCallbackURL: "/error",
    },
    // This endpoint requires session cookies.
    headers: await headers(),
});

And in the copied markdown or llms.txt only the client side:

<APIMethod path="/sign-in/magic-link" method="POST" requireSession>
  ```ts
  type signInMagicLink = {
      /**
       * Email address to send the magic link. 
       */
      email: string = "user@email.com"
      /**
       * User display name. Only used if the user is registering for the first time. 
       */
      name?: string = "my-name"
      /**
       * URL to redirect after magic link verification. 
       */
      callbackURL?: string = "/dashboard"
      /**
       * URL to redirect after new user signup
       */
      newUserCallbackURL?: string = "/welcome"
      /**
       * URL to redirect if an error happen on verification
       * If only callbackURL is provided but without an `errorCallbackURL` then they will be 
       * redirected to the callbackURL with an `error` query parameter.
       */
      errorCallbackURL?: string = "/error"
  }
```

What version of Better Auth are you using?

1.3.7

System info

Not relevant

Which area(s) are affected? (Select all that apply)

Documentation

Auth config (if applicable)


Additional context

No response

Originally created by @FabianHertwig on GitHub (Sep 2, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4365 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - Go to the docs, e.g. https://www.better-auth.com/docs/plugins/magic-link - Click the copy markdown button or open the https://www.better-auth.com/llms.txt ### Current vs. Expected behavior For code examples that have a client and server side, the server side is missing. I would expect it to be also included. E.g. in the docs for https://www.better-auth.com/docs/plugins/magic-link we can see these two examples: Docs client side ```js const { data, error } = await authClient.signIn.magicLink({ email: "user@email.com", // required name: "my-name", callbackURL: "/dashboard", newUserCallbackURL: "/welcome", errorCallbackURL: "/error", }); ``` Docs server side ```js const data = await auth.api.signInMagicLink({ body: { email: "user@email.com", // required name: "my-name", callbackURL: "/dashboard", newUserCallbackURL: "/welcome", errorCallbackURL: "/error", }, // This endpoint requires session cookies. headers: await headers(), }); ``` And in the copied markdown or llms.txt only the client side: ```markdown <APIMethod path="/sign-in/magic-link" method="POST" requireSession> ```ts type signInMagicLink = { /** * Email address to send the magic link. */ email: string = "user@email.com" /** * User display name. Only used if the user is registering for the first time. */ name?: string = "my-name" /** * URL to redirect after magic link verification. */ callbackURL?: string = "/dashboard" /** * URL to redirect after new user signup */ newUserCallbackURL?: string = "/welcome" /** * URL to redirect if an error happen on verification * If only callbackURL is provided but without an `errorCallbackURL` then they will be * redirected to the callbackURL with an `error` query parameter. */ errorCallbackURL?: string = "/error" } ``` </APIMethod> ``` ### What version of Better Auth are you using? 1.3.7 ### System info ```bash Not relevant ``` ### Which area(s) are affected? (Select all that apply) Documentation ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 05:43:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 2, 2025):

The missing server-side code examples in copied markdown and llms.txt are due to how the documentation export works. The docs site uses React components to dynamically generate both client and server code samples at runtime, but the static markdown and llms.txt exports only include what is present in the raw markdown/MDX files—typically just the client-side type definitions inside <APIMethod> blocks. The export pipeline (using remark plugins) doesn't capture the server-side code generated by the UI components, so it's not an intentional omission but a limitation of the current tooling and authoring process. To include server-side examples in exports, you’d need to either manually add those code blocks to the markdown or update the export logic to process and include the dynamically generated examples from the React components. There are no recent PRs or docs addressing this, so it appears to be an undocumented gap rather than a known issue.
Source: docs/app/docs/lib/get-llm-text.ts
Source: docs/components/api-method.tsx

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3246515245 --> @dosubot[bot] commented on GitHub (Sep 2, 2025): <!-- Answer --> The missing server-side code examples in copied markdown and llms.txt are due to how the documentation export works. The docs site uses React components to dynamically generate both client and server code samples at runtime, but the static markdown and llms.txt exports only include what is present in the raw markdown/MDX files—typically just the client-side type definitions inside `<APIMethod>` blocks. The export pipeline (using remark plugins) doesn't capture the server-side code generated by the UI components, so it's not an intentional omission but a limitation of the current tooling and authoring process. To include server-side examples in exports, you’d need to either manually add those code blocks to the markdown or update the export logic to process and include the dynamically generated examples from the React components. There are no recent PRs or docs addressing this, so it appears to be an undocumented gap rather than a known issue. [Source: docs/app/docs/lib/get-llm-text.ts](https://github.com/better-auth/better-auth/blob/23daf79a427ea987a4d94d0431e0fb306d26d464/docs/app/docs/lib/get-llm-text.ts) [Source: docs/components/api-method.tsx](https://github.com/better-auth/better-auth/blob/23daf79a427ea987a4d94d0431e0fb306d26d464/docs/components/api-method.tsx) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0889abe7-fb6b-4095-9c63-ddf1d640b7ca?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4365)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9914