Skip to main content

android_sms_gateway/
lib.rs

1//! # SMSGate
2//!
3//! A Rust client library for the [SMSGate](https://sms-gate.app) API.
4//!
5//! ## Quick Start
6//!
7//! ```no_run
8//! use android_sms_gateway::{Client, ClientConfig, types::Message};
9//!
10//! # async fn example() -> Result<(), android_sms_gateway::Error> {
11//! let config = ClientConfig::new()
12//!     .with_token("your-jwt-token");
13//!
14//! let client = Client::new(config)?;
15//!
16//! let health = client.check_health().await?;
17//! println!("Status: {:?}", health.status);
18//! # Ok(())
19//! # }
20//! ```
21//!
22//! ## Feature Flags
23//!
24//! | Feature | Description |
25//! |---------|-------------|
26//! | `rustls-tls` | Use `rustls` for TLS (default) |
27//! | `native-tls` | Use platform-native TLS |
28//! | `encryption` | Enable AES-256-CBC message encryption/decryption |
29
30pub mod client;
31pub mod config;
32pub mod error;
33pub(crate) mod http;
34pub mod types;
35pub mod webhook;
36
37#[cfg(feature = "encryption")]
38pub mod encryption;
39
40pub use client::Client;
41pub use config::ClientConfig;
42pub use error::Error;
43
44/// Current version of the crate.
45pub const VERSION: &str = env!("CARGO_PKG_VERSION");
46
47/// Default base URL for the Android SMS Gateway API.
48pub const BASE_URL: &str = "https://api.sms-gate.app/3rdparty/v1";