Files
Vaibhav d5fde192d5 examples: migrate Edge Functions to @supabase/server (#46890)
- extends/supersedes: #46665 
- towards COM-269

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Standardized Edge Function entrypoints across examples to a consistent
`export default` shape, with runtime-provided admin access for
storage/database operations.
  * Updated public endpoint handling to use appropriate auth modes.
* **Bug Fixes**
* Improved error handling to return structured JSON responses with
correct HTTP status codes for invalid requests and failures.
  * Harmonized local invocation examples to use the right header format.
* **Chores**
* Updated example `verify_jwt` settings to disable JWT verification for
public/demo endpoints.
* **Documentation**
  * Fixed README typo and refreshed invocation curl examples.
* **Tests**
  * None.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Tomas Pozo <tomaspozogarzon@gmail.com>
2026-06-26 15:04:46 -05:00
..

Self-Host Maps on Supabase Storage with Protomaps

Create a static PMTiles Map file

Follow the instructions in the Protomaps docs to extract a my_area.pmtiles file.

Upload to Supabase Storage

  1. Create a new private bucket called maps-private.
  2. Upload your my_area.pmtiles file there.

Take note of the file size limits depending on your project tier.

Proxy through Edge Functions

You can use Supabase Edge Functions to set up fine grained access controls. Use the /supabase/functions/maps-private/index.ts.

You can also use Edge Functions with Supabase Auth JWTs to only render Maps for authenticated users for example. Read the docs.

  1. Deploy the function to your Supabase project: supabase functions deploy maps-private --no-verify-jwt.
  2. Update the protomaps.url in the index.html file.

Start simple web server

You can use python to serve the index.html file:

python3 -m http.server

Now navigate to http://localhost:8000/ to see your beauiful Map!