#async-client #management #system #hr #personio

personio-rs

Async Rust client for the Personio HR management system

2 releases

0.1.1 Feb 13, 2025
0.1.0 Feb 13, 2025

#314 in Authentication

Download history 250/week @ 2025-02-11

250 downloads per month

MIT license

15KB
97 lines

personio-rs

crates.io License: MIT

Async Rust client for Personio backed by tokio.

Usage

Add this to your Cargo.toml:

[dependencies]
personio-rs = "0.1.0"
tokio = { version = "1.0", features = ["full"] }

To get auth token:

use personio_rs::client::Client;
use std::env;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("Authenticating...");

    let client_id = env::var("CLIENT_ID")?;
    let client_secret = env::var("CLIENT_SECRET")?;

    let client = Client::new("MY_COMPANY", "MY_APP")?;
    let creds = client.auth(&client_id, &client_secret).await?;

    println!("{creds}");

    Ok(())
}

Dependencies

~7–19MB
~246K SLoC