[PR #2797] [CLOSED] feat: file-storage plugin (WIP) #12737

Closed
opened 2026-04-13 08:33:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2797
Author: @zpg6
Created: 5/26/2025
Status: Closed

Base: mainHead: feat/file-storage-plugin


📝 Commits (2)

  • c7cfd66 feat: file-storage plugin
  • ff669ea list files w/ filter and pagination and track storage usage w/ filter

📊 Changes

11 files changed (+1305 additions, -269 deletions)

View changed files

packages/file-storage/build.config.ts (+18 -0)
packages/file-storage/package.json (+56 -0)
packages/file-storage/src/client.ts (+9 -0)
packages/file-storage/src/index.ts (+428 -0)
packages/file-storage/src/schema.ts (+49 -0)
packages/file-storage/src/storage-providers/uploadthing.ts (+64 -0)
packages/file-storage/src/types.ts (+211 -0)
packages/file-storage/src/utils.ts (+30 -0)
packages/file-storage/tsconfig.json (+20 -0)
packages/file-storage/vitest.config.ts (+10 -0)
📝 pnpm-lock.yaml (+410 -269)

📄 Description

Adding a file-storage plugin to tie file uploads to users that upload them. This should be usable for profile images, file sharing, organization logos, and other use cases in your application.

Includes:

  • StorageProvider interface so that we can easily add more providers or users can bring their own.
  • schema options and ability to add additionalFields to the database table
  • canUploadFile for your custom pre-upload checks of whether the user can upload a file
  • onFileUploaded callback for your handling of file uploads completed

🔄 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/2797 **Author:** [@zpg6](https://github.com/zpg6) **Created:** 5/26/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/file-storage-plugin` --- ### 📝 Commits (2) - [`c7cfd66`](https://github.com/better-auth/better-auth/commit/c7cfd66e363a8c4df0bdd3fd65ea9e23179b816d) feat: file-storage plugin - [`ff669ea`](https://github.com/better-auth/better-auth/commit/ff669ead194349880ec7b0f469aab033b0df9fcd) list files w/ filter and pagination and track storage usage w/ filter ### 📊 Changes **11 files changed** (+1305 additions, -269 deletions) <details> <summary>View changed files</summary> ➕ `packages/file-storage/build.config.ts` (+18 -0) ➕ `packages/file-storage/package.json` (+56 -0) ➕ `packages/file-storage/src/client.ts` (+9 -0) ➕ `packages/file-storage/src/index.ts` (+428 -0) ➕ `packages/file-storage/src/schema.ts` (+49 -0) ➕ `packages/file-storage/src/storage-providers/uploadthing.ts` (+64 -0) ➕ `packages/file-storage/src/types.ts` (+211 -0) ➕ `packages/file-storage/src/utils.ts` (+30 -0) ➕ `packages/file-storage/tsconfig.json` (+20 -0) ➕ `packages/file-storage/vitest.config.ts` (+10 -0) 📝 `pnpm-lock.yaml` (+410 -269) </details> ### 📄 Description Adding a file-storage plugin to tie file uploads to users that upload them. This should be usable for profile images, file sharing, organization logos, and other use cases in your application. Includes: - `StorageProvider` interface so that we can easily add more providers or users can bring their own. - `schema` options and ability to add `additionalFields` to the database table - `canUploadFile` for your custom pre-upload checks of whether the user can upload a file - `onFileUploaded` callback for your handling of file uploads completed --- <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-13 08:33:52 -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#12737