[PR #1267] [CLOSED] feat: add databaseHooks for organizaton create & update #3725

Closed
opened 2026-03-13 11:08:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1267
Author: @tomhhealy
Created: 1/22/2025
Status: Closed

Base: mainHead: feature/organization-hooks


📝 Commits (3)

  • 1b37fc7 feat: add databaseHooks for organization create & update
  • 8ff4cde feat: Update docs to include database hook functionality
  • 71a5ec2 Merge branch 'better-auth:main' into feature/organization-hooks

📊 Changes

4 files changed (+96 additions, -12 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+26 -0)
📝 packages/better-auth/src/db/with-hooks.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/adapter.ts (+18 -11)
📝 packages/better-auth/src/types/options.ts (+51 -0)

📄 Description

Hi - first contribution. Love the work you've put into Better Auth - what a fantastic resource!

In this PR, I've added before & after database hooks for the Organization plugin and updated the docs with a small snippet for a simple "log to console" when an Organization is created or updated.
@Bekacru I can't seem to find the message from Discord now, but I believe you had plans to work on the organization plugin so I hope this fits in with those! 😃

The reason behind adding this was because of custom logic I wanted to execute at the time of the user creating the organization and I've been using the before hooks elsewhere already.


🔄 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/1267 **Author:** [@tomhhealy](https://github.com/tomhhealy) **Created:** 1/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/organization-hooks` --- ### 📝 Commits (3) - [`1b37fc7`](https://github.com/better-auth/better-auth/commit/1b37fc7772f0a65ab97ac35290507872af69ff11) feat: add databaseHooks for organization create & update - [`8ff4cde`](https://github.com/better-auth/better-auth/commit/8ff4cde62117c6b95c4dcc323f3dcfc71dc01aea) feat: Update docs to include database hook functionality - [`71a5ec2`](https://github.com/better-auth/better-auth/commit/71a5ec2505a91e35733f5f76d77e6e94093b7319) Merge branch 'better-auth:main' into feature/organization-hooks ### 📊 Changes **4 files changed** (+96 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+26 -0) 📝 `packages/better-auth/src/db/with-hooks.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+18 -11) 📝 `packages/better-auth/src/types/options.ts` (+51 -0) </details> ### 📄 Description Hi - first contribution. Love the work you've put into Better Auth - what a fantastic resource! In this PR, I've added before & after database hooks for the `Organization` plugin and updated the docs with a small snippet for a simple "log to console" when an Organization is created or updated. @Bekacru I can't seem to find the message from Discord now, but I believe you had plans to work on the organization plugin so I hope this fits in with those! 😃 The reason behind adding this was because of custom logic I wanted to execute at the time of the user creating the organization and I've been using the before hooks elsewhere already. --- <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 11:08:22 -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#3725