Crate supabase_auth_redux

Source
Expand description

§Supabase Auth Rust Client

A Rust client library for interacting with the Supabase Auth API.

This library provides a simple and type-safe way to integrate Supabase authentication into your Rust applications, supporting common authentication flows like signup, signin, token refresh, and user management.

§Example

use supabase_auth_redux::{AuthClient, AuthError, IdType};

// Initialize the client
let auth_client = AuthClient::new("https://your-project.supabase.co", "your-anon-key")?;

// Sign up a new user
let (user, access_token) = auth_client
    .signup(
        IdType::Email("user@example.com".to_string()),
        "secure_password".to_string(),
        None,
    )
    .await?;

// Sign in an existing user
let token_response = auth_client
    .signin_with_password(
        IdType::Email("user@example.com".to_string()),
        "secure_password".to_string(),
    )
    .await?;

Re-exports§

pub use models::token::TokenResponse;
pub use models::user::UserSchema as User;
pub use GoTrueErrorResponse as Error;

Modules§

models
Data models for the Supabase Auth API

Structs§

AuthClient
The main authentication client for interacting with Supabase Auth API
AuthClientBuilder
Builder for constructing an AuthClient with custom configuration
GoTrueErrorResponse
Error response from the GoTrue/Supabase Auth API

Enums§

AuthError
Errors that can occur when interacting with the Supabase Auth API
IdType
Identifier type for authentication operations