Skip to main content
Supabase Storage exposes an S3-compatible API at https://<project-ref>.storage.supabase.co/storage/v1/s3, signed with AWS Signature V4 using Supabase S3 Access Keys (not your project anon / service-role JWT). MIRAGE derives the endpoint from your project_ref automatically and forces path-style URLs.

Credentials

1. Create an S3 access key

  1. Open the Supabase dashboard → your project → Storage → Settings → S3 Access Keys
  2. Click New access key, scope to the bucket(s) you want MIRAGE to see
  3. Copy the Access key ID and Secret access key, the secret is shown once

2. Environment variables

SUPABASE_REGION is metadata only, Supabase Storage accepts any region string but requires one for SigV4 signing. Use the region you selected when creating the project.

Node (server-side)

Browser (presigned URLs)

Same pattern as every other S3-compat backend: the browser calls a presignedUrlProvider callback that hits your server, which signs each S3 operation against the Supabase endpoint and returns the URL. The browser fetch()es directly.

1. Server: sign URLs with the Supabase endpoint

Supabase requires path-style URLs (forcePathStyle: true). Virtual-hosted style is not supported.

2. Browser: wire it up

3. Configure CORS on the bucket

Supabase Storage’s S3 API respects the bucket’s CORS configuration, which is set in the Supabase dashboard:
  1. Project → Storage → Settings → Policies / CORS configuration
  2. Add http://localhost:5173 (and any production origins)
  3. Methods: GET, PUT, HEAD, DELETE, POST
  4. Headers: *
  5. Exposed headers: ETag, Content-Length, Content-Type, Last-Modified
See the Supabase resource docs for the equivalent Python wiring.