screenshotfreeapi 1.0.0

Official Rust client for ScreenshotFreeAPI — Screenshot-as-a-Service
Documentation
//! # screenshotfreeapi
//!
//! Official Rust client for the [ScreenshotFreeAPI](https://screenshotfreeapi.com) — a
//! production-grade Screenshot-as-a-Service platform.
//!
//! ## Quick start
//!
//! Add to `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! screenshotfreeapi = "1"
//! tokio = { version = "1", features = ["full"] }
//! ```
//!
//! ```rust,no_run
//! use screenshotfreeapi::ScreenshotFreeAPIClient;
//!
//! #[tokio::main]
//! async fn main() -> screenshotfreeapi::Result<()> {
//!     let client = ScreenshotFreeAPIClient::new("sfa_your_api_key");
//!     let result = client.capture("https://stripe.com").await?;
//!     println!("{}", result.screenshots[0].url);
//!     Ok(())
//! }
//! ```
//!
//! ## Resources
//!
//! Access each group of endpoints through the corresponding field on [`ScreenshotFreeAPIClient`]:
//!
//! - `client.auth` — account registration and JWT management
//! - `client.screenshots` — enqueue web, mobile, and HTML captures
//! - `client.jobs` — poll status, fetch results
//! - `client.billing` — plans, usage, upgrades
//! - `client.workspaces` — team workspaces and member management
//! - `client.monitors` — scheduled app-capture monitors
//! - `client.integrations` — Zapier REST Hooks
//!
//! ## Webhook verification
//!
//! ```rust
//! use screenshotfreeapi::verify_webhook_signature;
//!
//! let body = br#"{"jobId":"abc","status":"completed"}"#;
//! let sig = "the-value-of-X-ScreenshotFree-Signature-header";
//! let secret = "your_webhook_secret";
//!
//! if verify_webhook_signature(body, sig, secret).is_ok() {
//!     // safe to process
//! }
//! ```

mod client;
mod error;
mod http;
pub mod resources;
mod types;
mod webhooks;

// ---------------------------------------------------------------------------
// Public re-exports
// ---------------------------------------------------------------------------

pub use client::ScreenshotFreeAPIClient;
pub use error::{Result, ScreenshotFreeAPIError};
pub use types::{
    // Auth
    RefreshRequest,
    RefreshResponse,
    RegisterRequest,
    RegisterResponse,
    TokenRequest,
    TokenResponse,
    // Screenshots
    Dimensions,
    HtmlScreenshotOptions,
    MobileScreenshotOptions,
    WebScreenshotOptions,
    // Jobs
    EnqueueResponse,
    JobResult,
    JobStatusResponse,
    Metadata,
    Screenshot,
    // Billing
    BillingUsage,
    CancelResponse,
    CurrentPlan,
    DailyUsage,
    Plan,
    UpgradeRequest,
    UpgradeResponse,
    VerifyResponse,
    // Workspaces
    CreateWorkspaceRequest,
    InviteRequest,
    UpdateRoleRequest,
    Workspace,
    WorkspaceActionResponse,
    WorkspaceDetail,
    WorkspaceMember,
    // Monitors
    AppMonitor,
    CreateMonitorRequest,
    MonitorHistory,
    // Integrations
    ZapierSubscribeRequest,
    ZapierSubscribeResponse,
    ZapierTriggerSample,
    ZapierUnsubscribeResponse,
    // Health
    HealthResponse,
};
pub use resources::screenshots::WaitOptions;
pub use webhooks::verify_webhook_signature;