Expand description
§bibby — The Official Rust SDK for Bytebury
bibby provides strongly-typed async clients, smart .env initialization,
constant-time webhook signature verification, and ergonomic macros for every
Bytebury developer product:
| Service | Accessor | What it does |
|---|---|---|
| Geo | Bibby::geo | IPv4/IPv6 geolocation, SVG maps, random IPs, corrections |
| Images | Bibby::images | Resize, crop, transform, vectorize, analyze, icons, diff, QR codes |
Bibby::pdf | HTML/CSS (MiniJinja) and live URL to PDF rendering | |
| Mailer | Bibby::mailer | Transactional email sending (with idempotency) and email validation |
| Uploader | Bibby::uploader | Private/public file storage, signed URLs, share links, one-time upload links |
| Cron | Bibby::cron | Scheduled UTC HTTP jobs, manual runs, run history, schedule previews |
| Forms | Bibby::forms | HTML form backends, submissions, CSV export |
| Webhooks | Bibby::webhooks | Signed outgoing webhooks, event publishing, replay, HMAC verification |
| Monitors | Bibby::monitors | Uptime monitors, on-demand checks, 90-day status summaries, incidents, heartbeats |
| Vault | Bibby::vault | Encrypted secrets, .env import/export, versions, burn-after-reading shares |
§Smart .env Initialization
Add BYTEBURY_API_TOKEN=bb_live_... to your .env file (or environment), then call
Bibby::init():
use bibby::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
// Automatically loads `.env` (if present) and reads `BYTEBURY_API_TOKEN`.
// Optionally honors `BYTEBURY_API_URL` for local/staging gateways.
let client = Bibby::init()?;
let geo = client.geo().lookup("1.1.1.1").await?;
println!("{} — {}", geo.ip, geo.country.name);
let email = email! {
to: "ada@example.com",
subject: "Hello from Bibby",
html: "<h1>Welcome to Bytebury!</h1>",
};
client.mailer().send(&email).await?;
Ok(())
}§Ergonomic Macros
email!— concisemailer::SendEmailRequestconstructionimage_ops!— readableimages::Operationpipeline DSLpdf!— concisepdf::RenderPdfRequestwith inline JSON template datawebhook_event!— concisewebhooks::PublishEventRequestwith inline JSON payloadheaders!—BTreeMap<String, String>header literal for Cron, Webhooks, and Monitorsvault_ref!— builds{{vault:project/environment/KEY}}header placeholders
Re-exports§
pub use error::Error;pub use error::Result;pub use pagination::Page;pub use pagination::PageParams;pub use services::cron;pub use services::forms;pub use services::geo;pub use services::images;pub use services::mailer;pub use services::monitors;pub use services::pdf;pub use services::uploader;pub use services::vault;pub use services::webhooks;
Modules§
- error
- Error types returned by the Bytebury SDK.
- pagination
- Shared pagination types used across Bytebury list endpoints.
- prelude
- Convenient re-exports for common Bytebury SDK types and macros.
- services
- Service clients and request/response models for every Bytebury product.
Macros§
- Builds a
SendEmailRequestwith concise syntax. - headers
- Builds a
BTreeMap<String, String>of HTTP headers for Cron jobs, Webhook endpoints, and Uptime monitors. - image_
ops - Builds a
Vec<Operation>pipeline for Bytebury Images. - Builds a
RenderPdfRequestwith inline template data and ergonomic options. - vault_
ref - Formats a Bytebury Vault secret placeholder (
{{vault:project/environment/KEY}}) for use inside Cron, Webhook, and Monitor headers. - webhook_
event - Builds a
PublishEventRequestwith an inline JSON payload.
Structs§
- Bibby
- The main Bytebury SDK client.
- Bibby
Builder - Builder for customizing a
Bibbyclient.
Constants§
- API_
TOKEN_ ENV - Default environment variable read by
Bibby::init. - API_
URL_ ENV - Optional environment variable checked by
Bibby::initto overrideDEFAULT_BASE_URL. - DEFAULT_
BASE_ URL - Default base URL for the Bytebury public API gateway.