To upload data to Supabase Storage, we can use the Supabase JavaScript client.
Uploading a file
To upload a file, we can use the upload
method.
For example, the code below is the code that uploads a user's profile image to the avatars
bucket:
You can also combine the above with useSWRMutation
from SWR
when you use the code above from a React component:
And then, you can use it like this: