Track UploadThing files in Convex with automated access control, expiration cleanup, and webhook verification for secure file management.
npm install @mzedstudio/uploadthingtrackAbout
A Convex component for tracking UploadThing files with access control, expiration, and webhook verification.
UploadThing Track provides configurable TTL policies that automatically clean up expired files from both UploadThing and your Convex database. It runs scheduled functions to identify and remove files based on access patterns and expiration rules you define.
The component implements ownership validation and permission checks before serving file URLs. It tracks who uploaded each file and validates access requests against your defined authorization rules.
UploadThing Track automatically validates webhook signatures using cryptographic verification to ensure requests actually come from UploadThing. It handles the signature validation and parses webhook payloads for file lifecycle events.
The component stores comprehensive file metadata including upload timestamps, file sizes, access counts, and ownership information in your Convex database. This enables analytics and informed cleanup decisions based on actual usage patterns.
Yes, UploadThing Track is designed to work alongside existing UploadThing implementations. It operates as a tracking layer that monitors file lifecycle events through webhooks without interfering with your current upload flows or file serving.
UploadThing Track uses configurable TTL policies combined with access tracking to identify truly unused files. It monitors file access patterns and only removes files that meet both age and inactivity criteria you define, protecting actively used files from deletion.
UploadThing Track processes upload completion, deletion, and error events from UploadThing webhooks. It verifies each webhook signature cryptographically and updates your Convex database with the latest file status and metadata changes.
Yes, UploadThing Track allows you to define custom permission functions that can check user roles, file ownership, and file metadata before granting access. You can implement different access patterns for different file types or user groups within your Convex functions.