mcaptcha-api-rs/README.md

26 lines
834 B
Markdown

[![status-badge](https://ci.batsense.net/api/badges/107/status.svg)](https://ci.batsense.net/repos/107)
---
# mcaptcha-api-rs: Library to interact with with mCaptcha API
This library provides a convenient interface to validate [mCaptcha authorization
tokens](https://mcaptcha.org/docs/webmasters/terminology#authorization-token) presented by
Visitors against your mCaptcha instances. It uses [reqwest](https://crates.io/crates/reqwest),
and `native-tls` under the hood to communicate with the API.
## Install
```bash
cargo add mcaptcha-api-rs
```
## Example
```rust,no_run
use url::Url;
use mcaptcha_api_rs::MCaptcha;
let mcaptcha = MCaptcha::new("sitekeyfromdashboard", "secretfromdashboadr", Url::parse("https://mcaptcha.example.com").unwrap());
assert!(mcaptcha.verify("authorizationtokenfromvisitor").await.unwrap());
```