[PR #802] [MERGED] Docs/concept/plugin refactor #3482

Closed
opened 2026-03-13 10:55:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/802
Author: @ping-maxwell
Created: 12/7/2024
Status: Merged
Merged: 12/8/2024
Merged by: @Bekacru

Base: mainHead: docs/plugin-unique-ids


📝 Commits (4)

  • fd615ca docs(update): concept/plugins - Additional info to creating plugins
  • 4a3f6ba docs(update): reordered plugins docs to be more sensible.
  • 22312fe update: add documentation for getSessionFromCtx
  • b527e43 docs: make plugins consitently a function and improve some parts

📊 Changes

1 file changed (+198 additions, -96 deletions)

View changed files

📝 docs/content/docs/concepts/plugins.mdx (+198 -96)

📄 Description

  • Made sure the reader knows the ID can be the same for both server & client plugins.
  • Added demo code to show the creation of both the server & the client plugins.
  • Made the myPlugin and myClientPlugin have an export. An opinionated default.
  • The heading "When to use Middleware, Hooks, On Request, On Response" was removed:
    • That heading was written after the doucmentation of middleware, hooks, on request, etc. Most people skim the docs to find what they want, to read all of that code not knowing what each function does, makes it harder for them to get to the end and finally read that heading which provides more context.
    • I added a new heading, which is above middleware, hooks, etc and that explains each primary function and when you would use them.
  • Fixed the client's endpoint interface code block which incorrectly imported {myPlugin} from ".//plugin", rather than "./plugin".
  • Added documentation for getSessionFromCtx.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/802 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 12/7/2024 **Status:** ✅ Merged **Merged:** 12/8/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `docs/plugin-unique-ids` --- ### 📝 Commits (4) - [`fd615ca`](https://github.com/better-auth/better-auth/commit/fd615ca83d04e4f947d2c0f21eb711226897fcde) docs(update): concept/plugins - Additional info to creating plugins - [`4a3f6ba`](https://github.com/better-auth/better-auth/commit/4a3f6ba119623af44ec67be648e0a4d2093b50fb) docs(update): reordered plugins docs to be more sensible. - [`22312fe`](https://github.com/better-auth/better-auth/commit/22312feeed34d824e02e898439ad077cfc085459) update: add documentation for `getSessionFromCtx` - [`b527e43`](https://github.com/better-auth/better-auth/commit/b527e435ac951407d7901835bac14edf761221cd) docs: make plugins consitently a function and improve some parts ### 📊 Changes **1 file changed** (+198 additions, -96 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/plugins.mdx` (+198 -96) </details> ### 📄 Description - Made sure the reader knows the ID can be the same for both server & client plugins. - Added demo code to show the creation of both the server & the client plugins. - Made the `myPlugin` and `myClientPlugin` have an `export`. An opinionated default. - The heading "When to use Middleware, Hooks, On Request, On Response" was removed: - That heading was written after the doucmentation of middleware, hooks, on request, etc. Most people skim the docs to find what they want, to read all of that code not knowing what each function does, makes it harder for them to get to the end and finally read that heading which provides more context. - I added a new heading, which is above middleware, hooks, etc and that explains each primary function and when you would use them. - Fixed the client's endpoint interface code block which incorrectly imported {myPlugin} from ".//plugin", rather than "./plugin". - Added documentation for `getSessionFromCtx`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 10:55:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#3482