Expand description
§FlowGlad Rust SDK
This is the official Rust SDK for FlowGlad, an open-source billing infrastructure for developers.
§Quick Start
use flowglad::{Client, Config};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a client
let config = Config::new("sk_test_...");
let client = Client::new(config)?;
// Use the client to interact with the API
// let customers = client.customers().list().await?;
Ok(())
}§Features
- Type-safe API: Leverage Rust’s type system to prevent errors
- Async/await: Built on tokio for high-performance async IO
- Automatic retries: Intelligent retry logic with exponential backoff
- Rich errors: Detailed error types for easy debugging
§Configuration
The SDK can be configured using the Config struct:
use flowglad::Config;
use std::time::Duration;
let config = Config::builder()
.api_key("sk_test_...")
.timeout(Duration::from_secs(60))
.max_retries(5)
.build()
.unwrap();Re-exports§
pub use client::Client;pub use config::Config;pub use error::Error;pub use error::Result;pub use types::Currency;pub use types::CustomerId;pub use types::Interval;pub use types::ListResponse;pub use types::Metadata;pub use types::Money;pub use types::ProductId;pub use types::Status;pub use types::Timestamp;