Supabase
createSupabaseAdapter uploads directly to Supabase Storage.
import { createSupabaseAdapter } from "../components/DropUpload"
const adapter = createSupabaseAdapter({
url: "https://your-project.supabase.co",
bucket: "uploads",
getToken: () => process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
})
<DropUpload uploadAdapter={adapter} />getTokencan return the anon key for public buckets, or a user's JWT for buckets governed by row-level security policies.- Files are uploaded to a timestamp-prefixed path (
{Date.now()}-{filename}) to avoid collisions; existing objects at that path are overwritten unless you passupsert: false. - The adapter resolves with the object's public URL — only usable if the bucket (or the specific object) is public.
Never ship a service-role key to the browser. Use the anon key with proper row-level security policies, or mint a short-lived token from your own backend.