Skip to content

Instantly share code, notes, and snippets.

@russellbits
Created August 12, 2023 13:03
Show Gist options
  • Save russellbits/bd68751b6b8e51c5eb4e0b885655d554 to your computer and use it in GitHub Desktop.
Save russellbits/bd68751b6b8e51c5eb4e0b885655d554 to your computer and use it in GitHub Desktop.
Supabase image resize
const { data } = supabase.storage
.from('public-bucket')
.getPunlicUrl('folder/avatar-1.png', {
transform: {
width:100,
height:100,
resize:'cover' // Can be values of cover (defaul) | contain | fill
// cover crops to frame size | contain keeps aspect ratio inside frame | fill stretches image to fill frame
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment