What problem does it solve?
Provides a secure, scalable authentication model that supports both anonymous visitors and authenticated users within a single Supabase-backed system, enabling safe realtime interactions and effective data access controls.
Core Features & Use Cases
- Two-Token System: Visitor token for anonymous access and User token for authenticated data operations.
- Single Supabase Auth User: A unified transport layer to support Realtime with proper differentiation via app_metadata.
- Dynamic JWT Metadata: app_metadata updated to reflect user context for Row Level Security enforcement.
- Automatic Token Switching: Client automatically selects and caches the appropriate token based on sign-in state.
- Row Level Security: Fine-grained access controls across public and private data.
- In-Memory Token Storage: Client-side caching to avoid localStorage and reduce exposure.
Quick Start
Initialize the client to obtain a visitor token for anonymous access, then switch to a user token after sign-in to enable full data access.