
Supabase Storage Has a Free API: S3-Compatible Object Storage with CDN and Image Transformations
Why Supabase Storage? Supabase Storage provides an S3-compatible object storage solution with built-in CDN, image transformations, and Row Level Security. If you need file uploads with authentication baked in, this is your shortcut. Quick Start npm install @supabase/supabase-js import { createClient } from ' @supabase/supabase-js ' ; const supabase = createClient ( ' https://your-project.supabase.co ' , ' your-anon-key ' ); // Upload a file const { data , error } = await supabase . storage . from ( ' avatars ' ) . upload ( ' public/avatar.png ' , file , { cacheControl : ' 3600 ' , upsert : false , }); console . log ( ' Uploaded: ' , data . path ); Image Transformations on the Fly No need for a separate image processing service: const { data } = supabase . storage . from ( ' avatars ' ) . getPublicUrl ( ' public/avatar.png ' , { transform : { width : 200 , height : 200 , resize : ' cover ' , quality : 80 , }, }); console . log ( data . publicUrl ); Signed URLs for Private Files const {
Continue reading on Dev.to Webdev
Opens in a new tab



