supabase-lib-rs

Crates.iosupabase-lib-rs
lib.rssupabase-lib-rs
version0.5.3
created_at2025-08-13 15:36:57.458933+00
updated_at2025-10-16 18:42:46.397409+00
descriptionA comprehensive, production-ready Rust client library for Supabase with full cross-platform support (native + WASM)
homepagehttps://github.com/nizovtsevnv/supabase-lib-rs
repositoryhttps://github.com/nizovtsevnv/supabase-lib-rs
max_upload_size
id1793750
size739,712
Nick Nizovtsev (nizovtsevnv)

documentation

https://docs.rs/supabase-lib-rs

README

Supabase Rust Client

CI docs.rs Crates.io License: MIT

A comprehensive, production-ready Rust client library for Supabase. This library provides a clean, type-safe, and efficient interface to interact with all Supabase services.

✨ Features

  • 🔐 Authentication: Full auth support including MFA, OAuth, Phone Auth, Magic Links, Anonymous Sign-in, and Advanced Token Management
  • 💾 Session Management: Cross-tab Sync, Platform Storage, Session Encryption, Session Events
  • 🗄️ Database: Advanced Queries, Raw SQL, and Type-safe PostgREST operations
  • 📁 Storage: File operations with Resumable Uploads, Advanced Metadata, Storage Policies, and Real-time Events
  • 📡 Realtime: WebSocket subscriptions with Presence System, Broadcast Messages, Advanced Filters, and Connection Pooling
  • Cross-Platform: Full Native (Tokio) and WebAssembly (WASM) support
  • 🛡️ Type Safety: Full Rust type system integration
  • 🔧 Well Tested: 113 comprehensive tests (41 unit + 72 doc tests)

📦 Installation

Add this to your Cargo.toml:

[dependencies]
supabase-lib-rs = "0.5.3"
tokio = { version = "1.0", features = ["full"] }

Or use cargo to add it:

cargo add supabase-lib-rs

🏃 Quick Start

use supabase::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    // Initialize the client
    let client = Client::new(
        "https://your-project.supabase.co",
        "your-anon-key"
    )?;

    // Authenticate user
    let auth_response = client
        .auth()
        .sign_in_with_email_and_password("user@example.com", "password")
        .await?;

    println!("User signed in: {:?}", auth_response.user);

    // Query database
    let posts = client
        .database()
        .from("posts")
        .select("id, title, content")
        .eq("status", "published")
        .order("created_at", Some(false))
        .limit(10)
        .execute()
        .await?;

    println!("Posts: {:?}", posts);

    Ok(())
}

📚 Documentation

Document Description
Examples & Usage Guide Comprehensive examples for all features
Configuration Guide Setup and configuration options
Architecture Guide Library design and architecture
WebAssembly Guide WASM integration and deployment
Testing Guide Testing setup and guidelines
Contributing Guide Development and contribution guidelines
Changelog Release history and changes
Roadmap Future development plans
API Documentation Complete API reference

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Quick Development Setup

# Clone the repository
git clone https://github.com/nizovtsevnv/supabase-lib-rs.git
cd supabase-lib-rs

# Setup development environment (requires Nix)
nix develop

# Run all checks
just check

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

🙏 Acknowledgments

  • Supabase for providing an amazing backend platform
  • The Rust community for excellent crates and tooling
  • Contributors who help improve this library

Made with ❤️ for the Rust and Supabase communities

Commit count: 0

cargo fmt