8 releases

new 0.0.8 Apr 21, 2024
0.0.7 Apr 21, 2024

#1074 in Web programming

Download history 103/week @ 2024-03-05 32/week @ 2024-03-12 327/week @ 2024-03-19 111/week @ 2024-03-26 307/week @ 2024-04-09 308/week @ 2024-04-16

1,053 downloads per month

MIT and GPL-3.0 licenses

20KB
323 lines

TSAR Client API

The official Rust SDK for TSAR. Rust is our primary focus, so this SDK will be the most maintained.

Example Import

tsar-client = "*"

Example Usage

use tsar_client::Client;

// Get these credentials from: https://tsar.cc/app/any/settings
const CLIENT_KEY: &str = "MFkwEwY...GAr/ITBqA==";
const APP_ID: &str = "00000000-0000-0000-0000-000000000000";

fn main() {
    let options = ClientOptions {
        app_id: APP_ID,
        client_key: CLIENT_KEY,
        debug_print: true,
    };

    let client = Client::new(options).expect("Failed to initialize client.");

    // If client formed successfully, then the user is authorized
    // Access user info directly from the client

    println!("User ID: {}", client.subscription.user.id);
}

lib.rs:

Official Rust SDK for TSAR

Dependencies

~9–22MB
~327K SLoC