Skip to content

Commit

Permalink
docs: add Supabase loader for next/image (#52480)
Browse files Browse the repository at this point in the history
### What?

- Adds Supabase Storage custom loader docs.

### Why?

- Help folks find supabase storage as an option for Image loaders.
  • Loading branch information
thorwebdev authored Jul 10, 2023
1 parent 4f8f9ae commit af1948b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/02-app/02-api-reference/05-next-config-js/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Alternatively, you can use the [`loader` prop](/docs/pages/api-reference/compone
- [ImageEngine](#imageengine)
- [Imgix](#imgix)
- [Thumbor](#thumbor)
- [Supabase](#supabase)

### Akamai

Expand Down Expand Up @@ -151,3 +152,16 @@ export default function thumborLoader({ src, width, quality }) {
return `https://example.com${params.join('/')}${src}`
}
```

### Supabase

```js
// Docs: https://supabase.com/docs/guides/storage/image-transformations#nextjs-loader
const projectId = '' // your supabase project id

export default function supabaseLoader({ src, width, quality }) {
return `https://${projectId}.supabase.co/storage/v1/render/image/public/${src}?width=${width}&quality=${
quality || 75
}`
}
```

0 comments on commit af1948b

Please sign in to comment.