Files
CatoandClaude Opus 5.5 b774f06de7 docs: correct drift in agent instructions, README and ops docs (#1348)
* docs: correct drift in agent instructions, README and ops docs

- Auto-merge sweep lives in bitbaum/fleet, not bitbaum/dotfiles; cd.yml is
  dispatch-only (handed off by ci.yml post-main), not a workflow_run listener
- Design-system docs match globals.css / tailwind.config.ts: warm accent
  #ff5c00, bg-bitcoinOrange (no bitcoin-orange utility), tiffany/orange are
  legacy; display typography is shipped
- .claude rules: real paths (src/lib/validation/, entityCrudHandler.ts,
  standardResponse.ts, withZod/withRateLimit/withRequestId, services/actors),
  real Button/Alert APIs, real rate limits, search via @bitbaum/searchkit,
  real payment modules, PostgREST instead of the POSTGRES_URL tunnel,
  lint-staged pre-commit, eslint.config.mjs
- README/AGENTS/REVIEW: Next 16 / TS 6 / Tailwind 4, pnpm, messaging is not
  E2E-encrypted yet, beta not Live, CD deploys, migrations apply on deploy
- docs/: deploy process, CI/CD, migrations guide, moved docs/ paths, stale
  CLI-entity and edge-function docs flagged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* style(docs): prettier on the docs touched by the drift fix

lint-staged would have run this; the commit was made without hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 12:07:09 +02:00
..

Supabase Edge Functions

Status (checked 2026-10-19). Nothing in src/ reads NEXT_PUBLIC_CORS_PROXY_URL, scripts/deploy-cors-proxy.sh no longer exists, and the managed Supabase Cloud project the steps below deploy to was retired 2026-06. The function source is kept in supabase/functions/cors-proxy/; treat the deploy steps as historical.

This directory contains Supabase Edge Functions to help with various aspects of the application.

CORS Proxy

The cors-proxy Edge Function is a solution to CORS issues when making authenticated requests to Supabase. It works by proxying requests through a serverless function that adds the proper CORS headers.

Why is this needed?

When making authenticated requests with credentials: 'include' mode, browsers require specific CORS headers from the server:

  • Access-Control-Allow-Origin cannot be a wildcard (*) and must specify the exact origin
  • Access-Control-Allow-Credentials must be set to true

Some Supabase endpoints may respond with a wildcard, causing CORS errors.

How to deploy

  1. Make sure you have the Supabase CLI installed:

    npm install -g supabase
    
  2. Log in to Supabase CLI:

    supabase login
    
  3. Deploy the function (from the project root):

    ./scripts/deploy-cors-proxy.sh
    

    Or manually:

    supabase functions deploy cors-proxy --project-ref your-project-ref
    
  4. Set the required environment variables:

    supabase secrets set SUPABASE_URL="your-supabase-url" SUPABASE_ANON_KEY="your-supabase-anon-key" --project-ref your-project-ref
    
  5. Add the CORS proxy URL to your .env.local file:

    NEXT_PUBLIC_CORS_PROXY_URL=https://your-project-ref.supabase.co/functions/v1/cors-proxy
    

How it works

  1. Auth-related requests are detected in the Supabase client
  2. Instead of making the request directly to Supabase, the client redirects the request to the Edge Function
  3. The Edge Function makes the request to Supabase on behalf of the client
  4. The Edge Function adds the proper CORS headers to the response
  5. The response is returned to the client with the proper CORS headers

Testing

You can test the CORS proxy with:

curl -X GET "https://your-project-ref.supabase.co/functions/v1/cors-proxy?path=/rest/v1/health"