Order matters. Making the repo private doesn't help much; forks and scrapers already have it. Do this now:
- Rotate the key. In Supabase → Project Settings → API Keys. If your project uses the newer secret keys (
sb_secret_...), create a new one and delete the old one. If it's the legacy JWTservice_rolekey, you have to rotate the JWT secret; that also changes the anon key and logs everyone out, which is acceptable here. - Update the app to use the new key from an env var (server-only), redeploy.
- Check for damage: Supabase logs (API/Postgres) for unusual queries from unknown IPs, row counts, deleted data.
- Then clean history (git filter-repo) mostly for hygiene.
The app will break for a few minutes between 1 and 2. That's fine.