[PR #5192] [CLOSED] Update list organizations with skip and offset query #31438

Closed
opened 2026-04-17 22:18:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5192
Author: @notaphplover
Created: 10/9/2025
Status: Closed

Base: canaryHead: feat/update-list-organizations-with-skip-and-offset-query


📝 Commits (2)

  • abb0006 feat(organization): update listOrganizations endpoint with both limit and skip optional query
  • 712f13d docs: update docs

📊 Changes

4 files changed (+77 additions, -2 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+8 -0)
📝 packages/better-auth/src/plugins/organization/adapter.ts (+9 -1)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+38 -1)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+22 -0)

📄 Description

Changed

  • Updated GET /organization/list with optional limit and offset query parameters.
  • Updated tests accordingly.
  • Updated docs accordingly.

Context

After reading this comment, I wanted to propose this PR to provide query pagination options the same way GET /organization/list-members includes limit and offset query params.

Motivation

I want to have paginated queries to avoid performance bottlenecks when a large amount of organizations are about to be retrieved. Refer to #4586 for more information.

I'm also considering better-auth as one of the possible integrations for the future of the inversify HTTP tools. I do like this library and I would love to give my 5 cents to make it better.


Summary by cubic

Adds pagination to GET /organization/list with optional limit and offset to fetch organizations in pages. Mirrors /organization/list-members and helps avoid heavy responses for large org sets (addresses #4586).

  • New Features
    • Accept limit and offset query params (string or number) on /organization/list.
    • Validate and pass params to adapter; adapter applies limit/offset in queries.
    • Added tests for limit/offset paging and updated docs with param details.

🔄 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/5192 **Author:** [@notaphplover](https://github.com/notaphplover) **Created:** 10/9/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/update-list-organizations-with-skip-and-offset-query` --- ### 📝 Commits (2) - [`abb0006`](https://github.com/better-auth/better-auth/commit/abb0006d0c7740a9a8ea603c43cd888bfae3e1fd) feat(organization): update listOrganizations endpoint with both limit and skip optional query - [`712f13d`](https://github.com/better-auth/better-auth/commit/712f13d7209a7f987019049d58b2738020c82681) docs: update docs ### 📊 Changes **4 files changed** (+77 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+8 -0) 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+9 -1) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+38 -1) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+22 -0) </details> ### 📄 Description ## Changed - Updated `GET /organization/list` with optional `limit` and `offset` query parameters. - Updated tests accordingly. - Updated docs accordingly. ### Context After reading [this comment](https://github.com/better-auth/better-auth/issues/4586#issuecomment-3287762096), I wanted to propose this PR to provide query pagination options the same way `GET /organization/list-members` includes limit and offset query params. ### Motivation I want to have paginated queries to avoid performance bottlenecks when a large amount of organizations are about to be retrieved. Refer to #4586 for more information. I'm also considering `better-auth` as one of the possible integrations for the future of the [inversify HTTP tools](https://inversify.io/http/). I do like this library and I would love to give my 5 cents to make it better. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds pagination to GET /organization/list with optional limit and offset to fetch organizations in pages. Mirrors /organization/list-members and helps avoid heavy responses for large org sets (addresses #4586). - **New Features** - Accept limit and offset query params (string or number) on /organization/list. - Validate and pass params to adapter; adapter applies limit/offset in queries. - Added tests for limit/offset paging and updated docs with param details. <!-- End of auto-generated description by cubic. --> --- <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-04-17 22:18:41 -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#31438