This directory contains example applications demonstrating various features of the Supabase Utils Rust library. Each example focuses on a specific functionality and shows how to use it in practice.
- Rust toolchain installed
- Supabase CLI installed
- A running Supabase instance (the examples will try to connect to a local instance at
./supabase)
cd supabase
supabase startAll examples can be run using Cargo. For example:
cargo run --bin auth-example| Example | File | Description | Use Cases |
|---|---|---|---|
| Auth Example | cargo run --bin auth-example |
Demonstrates Supabase authentication and authenticated API requests | - User authentication - Making authenticated API calls - Getting user information |
| Broadcast Example | cargo run --bin broadcast-example |
Shows how to use Supabase's broadcast feature for real-time messaging | - Real-time notifications - Chat features - Broadcasting messages to multiple clients |
| Presence Example | cargo run --bin presence-example |
Demonstrates presence tracking in channels | - Online status indicators - Typing indicators - User presence tracking |
| JWT Stream Example | cargo run --bin jwt-stream-example |
Shows JWT token management and refresh handling | - Session management - Token refresh automation - Maintaining authenticated sessions |
| Database Updates Example | cargo run --bin db-updates-example |
Demonstrates real-time database change listening | - Real-time data synchronization - Live updates - Database change notifications |
| Client Example | cargo run --bin client-example |
Shows basic database operations with Supabase client | - Database queries - CRUD operations - Authenticated database requests |
All examples share some common features:
- Logging setup with
tracing - Configuration management
- Authentication handling