Expand description
§flarer
Rust client and CLI for Cloudflare’s Browser Rendering REST API.
flarer ships as both a library (this crate) and a flarer binary.
The library exposes the high-level Flarer client; the binary is gated
behind the default cli feature and provides an interactive CLI plus a
one-shot non-interactive mode.
§Library quickstart
use flarer::{Account, Flarer, Tool};
let account = Account::from_env()?;
let flarer = Flarer::builder().account(account).build()?;
flarer.verify().await?;
let markdown = flarer.run(Tool::Markdown, "https://example.com").await?;
println!("{}", markdown.display_string());§Library-only usage (no CLI deps)
Disable default features to avoid pulling clap, inquire, dotenv,
and tracing-subscriber:
flarer = { version = "0.1", default-features = false }Re-exports§
pub use account::Account;pub use client::DEFAULT_BASE_URL;pub use client::Flarer;pub use client::FlarerBuilder;pub use client::SnapshotOptions;pub use error::FlarerError;pub use error::Result;pub use tool::Tool;pub use types::CfEnvelope;pub use types::JsonOptions;pub use types::Output;pub use types::ResponseFormat;pub use types::SnapshotResult;
Modules§
- account
- Cloudflare account credentials.
- cli
- Interactive CLI for
flarer. Gated behind theclifeature. - client
- High-level
Flarerclient wrapping Cloudflare’s Browser Rendering API. - error
- Strongly-typed errors for the
flarercrate. - tool
- The set of Browser Rendering tools exposed by Cloudflare.
- types
- Request/response types and helpers.