notifica-rust-sdk 0.1.0

Rust client SDK for the Notifica notification service
Documentation

notifica-crate

Rust client SDK for the Notifica notification service.

Install this crate in any project that needs to broadcast notifications (email, push, webhooks) to the Notifica service.

Quick start

use notifica_crate::{EmailPayload, Notification, NotificaClient};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = NotificaClient::new(
        std::env::var("NOTIFICA_URL")?,    // e.g. "http://notifica:8000"
        std::env::var("NOTIFICA_TENANT")?, // e.g. "my-app"
    );

    client.send(
        "user_registered",
        Notification::new()
            .email(
                EmailPayload::new("alice@example.com")
                    .target_name("Alice")
                    .subject("Welcome!")
                    .param("code", "1234"),
            )
            .push(vec!["expo-device-token".into()]),
    ).await?;

    Ok(())
}