1

Flutterflow has a handy native feature for uploading images to Supabase storage, but it's not clear how the uploaded image can then be accessed if, as in my case, Supabase has a security policy on the bucket.

The policy is by design - I only want user-uploaded images to be available to the user that uploaded them, but I can't see an obvious way to make authenticated requests to Supabase to get the image, i.e. the GET needs the bearer token. Any clues?

gh0st
  • 87
  • 7

1 Answers1

3

If you have a private bucket and want to retrieve images from the bucket as a signed in user, you have to first create a signed URL and then load the image using the generated signed URL.

final String signedUrl = await supabase
  .storage
  .from('avatars')
  .createSignedUrl('avatar1.png', 60);
dshukertjr
  • 15,244
  • 11
  • 57
  • 94