UploadThing

Track UploadThing files in Convex with automated access control, expiration cleanup, and webhook verification for secure file management.

Installation

npm install @mzedstudio/uploadthingtrack

About UploadThing

About
A Convex component for tracking UploadThing files with access control, expiration, and webhook verification.

Benefits

Use cases

how to automatically delete uploaded files after expiration in Convex

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.

secure file access control with UploadThing and Convex

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.

verify UploadThing webhook signatures in Convex

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.

track file metadata and usage in Convex database

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.

Frequently asked questions

Does UploadThing Track work with existing UploadThing integrations?

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.

How does the automatic file cleanup prevent accidentally deleting active files?

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.

What webhook events does the component handle from UploadThing?

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.

Can I customize the access control rules for different file types?

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.

Links