UploadSignal

Streamlined file hosting for developers

Tired of the complexity of S3? UploadSignal simplifies the process with a secure and straightforward solution designed specifically for developers. From initiating uploads to server-side handling, we've got everything you need covered.

Your Server. Our Bandwidth.

The right balance of security and simplicity.

You manage the authentication on your system, while we take care of the file transfer.

server.ts
export const fileRouter = {
  imageUploader: f({ maxFileSize: "4MB" })
    .middleware(async ({ req }) => {
      // This code runs on your server before upload
      const user = await auth(req);
      
      // Throw to block uploading
      if (!user)
        throw new UploadThingError("Unauthorized");
        
      // Return metadata to client
      return { userId: user.id };
    })
    .onUploadComplete(async ({ metadata, file }) => {
      // ...
    }),
} satisfies FileRouter;
client.tsx
<UploadButton
  endpoint="imageUploader" // Typesafe btw
  onClientUploadComplete={(response) => ...}
  onUploadError={(error) => ...}
/>