Local PostgREST returns PGRST301 (Invalid JWT parts) when createClient sb_secret/sb_publish
What I’m trying to do
- Run a local Supabase (via supabase CLI) and have a Node/Express backend query a table (projects) using @supabase/supabase-js. - Verify health with a small script that does a simple select: id, updated_at from projects limit 1.
What’s going wrong - The SDK initializes, but the REST query fails with: - JWSError (CompactDecodeError Invalid number of parts: Expected 3 parts; got 1) - Code: PGRST301 - This points to PostgREST rejecting the Authorization token (not a valid JWT). - I’m using the new-style local keys supabase status prints: sbpublishable... and sbsecret... - If these keys end up in Authorization: Bearer ..., the error occurs.
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.