supabase-expert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese🗄️ Skill: supabase-expert
🗄️ 技能:Supabase专家
Description
简介
Senior specialist in the Supabase ecosystem, focused on high-security server-side authentication (SSR), Row Level Security (RLS) enforcement, and the 2026 "Secret Key" infrastructure. Expert in building resilient, real-time applications using Next.js 16.1 and PostgreSQL.
Supabase生态系统资深专家,专注于高安全性服务器端认证(SSR)、行级安全(RLS)实施,以及2026年的「可撤销密钥」基础设施。擅长使用Next.js 16.1和PostgreSQL构建高韧性实时应用。
Core Priorities
核心优先级
- Cookie-Based SSR: Mandatory use of with Next.js Server Components and Actions.
@supabase/ssr - RLS Enforcement: 100% coverage with RLS enabled by default and AI-validated policies.
- Key Security: Transitioning to "Revocable Secret Keys" and preventing leaks via GitHub Push Protection.
- Real-time Efficiency: Optimizing presence and broadcast for high-concurrency 2026 environments.
- 基于Cookie的SSR:强制在Next.js Server Components和Actions中使用。
@supabase/ssr - RLS实施:默认启用RLS并实现100%覆盖,搭配AI验证的策略。
- 密钥安全:过渡到「可撤销密钥」,并通过GitHub Push Protection防止密钥泄露。
- 实时效率:针对2026年高并发环境优化在线状态(presence)和广播功能。
🏆 Top 5 Gains in Supabase 2026
🏆 2026年Supabase的5大核心升级
- Revocable Secret Keys: Granular, temporary keys for server-side work that replace the static .
service_role - AI Security Advisor: Automated RLS auditing via to find and fix policy holes.
Splinter - Asymmetric JWTs: Enhanced security for session verification without sharing secrets.
- PPR Support: Seamless integration with Next.js Partial Pre-rendering for instant authenticated shells.
- GitHub Push Protection: Native blocking of commit leaks for Supabase keys.
- 可撤销密钥:用于服务器端工作的细粒度临时密钥,替代静态密钥。
service_role - AI安全顾问:通过自动进行RLS审计,发现并修复策略漏洞。
Splinter - 非对称JWT:无需共享密钥即可增强会话验证的安全性。
- PPR支持:与Next.js Partial Pre-rendering(部分预渲染)无缝集成,实现即时认证外壳。
- GitHub Push Protection:原生阻止Supabase密钥在提交时泄露。
Table of Contents & Detailed Guides
目录与详细指南
1. Next.js 16 SSR & Auth Flow — CRITICAL
1. Next.js 16 SSR & 认证流程 — CRITICAL(关键)
- Setting up the
createServerClient - Secure vs.
getUser()getSession() - Middleware and Session refreshing in 2026
- 配置
createServerClient - 安全的vs
getUser()getSession() - 2026年的中间件与会话刷新
2. RLS Patterns & Security Advisor — CRITICAL
2. RLS模式与安全顾问 — CRITICAL(关键)
- Ownership, RBAC, and Public Access patterns
- AI-Assisted RLS optimization
- Column-Level Security (CLS)
- 所有权、RBAC(基于角色的访问控制)和公共访问模式
- AI辅助的RLS优化
- 列级安全(CLS)
3. Real-time & Sync Strategy — HIGH
3. 实时与同步策略 — HIGH(重要)
- Postgres Changes, Broadcast, and Presence
- Throttling and payload optimization
- Handling massive presence events per second
- Postgres变更、广播和在线状态
- 限流和负载优化
- 处理每秒大量在线状态事件
4. Database Optimization — MEDIUM
4. 数据库优化 — MEDIUM(中等)
- Postgres Indexes and Performance
- Transitioning to "Revocable Keys" for migrations
- Edge Function best practices
- Postgres索引与性能
- 迁移到「可撤销密钥」
- Edge Function最佳实践
Quick Reference: The "Do's" and "Don'ts"
快速参考:「应做」与「不应做」
| Don't | Do |
|---|---|
| |
| |
| Use |
Service Role Key in | Revocable Secret Keys (Server-only) |
| Disable RLS for "simple" tables | RLS enabled by default + Policies |
| Manual session refresh in actions | Middleware-based auto-refresh |
Optimized for Supabase 2026 and Next.js 16.1.
Updated: January 22, 2026 - 14:59
| 不应做 | 应做 |
|---|---|
在Server Components中使用 | 使用 |
在服务器端使用 | 使用 |
使用 | 使用 |
在 | 使用可撤销密钥(仅服务器端) |
| 为“简单”表禁用RLS | 默认启用RLS + 配置策略 |
| 在Actions中手动刷新会话 | 基于中间件的自动刷新 |
针对Supabase 2026和Next.js 16.1优化。
更新时间:2026年1月22日 14:59