📄 SKILL.md

← Vault

name: supabase-vps-vs-cloud-jwt-mismatch

description: Debug JWT token incompatibility between Supabase VPS (self-hosted) and Supabase Cloud — tokens signed by one environment are rejected by the other

triggers:

- "token unauthorized supabase cloud"

- "JWT_SECRET mismatch supabase"

- "edge function 401 after moving between VPS and Cloud"

- "manage-users unauthorized cloud VPS token"


Supabase VPS vs Cloud JWT Mismatch

The Problem

You have a Supabase instance running on a VPS (self-hosted) and another on Supabase Cloud. When you call a Supabase Cloud Edge Function using an access token issued by the VPS GoTrue auth service, you get {"error":"Unauthorized"}.

`

VPS GoTrue (JWT_SECRET: kETxz0JNJhJyg5UYxbd8zG6g2v9kXTYZGjY+3v7LUKI=)

↓ signs token with VPS JWT_SECRET

access_token

↓ sent to Cloud function

Cloud Edge Runtime verifies with CLOUD's SERVICE_ROLE_KEY (RSA public key)

↓ mismatch → Unauthorized

`

Why This Happens