#twitch #api #api-bindings

libtwitch-rs

Rust library for the Twitch APIv5 (Kraken)

5 unstable releases

0.3.0 Oct 31, 2020
0.2.0 Oct 28, 2020
0.1.2 Oct 16, 2019
0.1.1 Oct 16, 2019
0.1.0 Oct 7, 2019

#64 in #twitch

LGPL-3.0-or-later

110KB
3K SLoC

libtwitch-rs docs.rs crates.io version dependency status GNU LGPLv3

A Rust library for the Twitch APIv5 (Kraken).

Contributing

Help for this project is highly appreciated. This was built against Twitch APIv5 (Kraken). Take a look into the issues if you want to contribute to the project.

Fork it, implement your changes and make a Pull-Request against the feature-dev branch of this repo.

Usage

use libtwitch_rs;
use libtwitch_rs::users;

...

let mut c = libtwitch_rs::new(String::from(CLIENTID));
c.set_oauth_token(TOKEN);

if let Some(user) = match users::get(&c) {
    Ok(r)  => { assert!(r.email.is_some()); Some(r) },
    Err(r) => { println!("{:?}", r); assert!(false); None }
    } {
    let user_id = user.id.to_string();

    match users::get_by_id(&c, &user_id) {
        Ok(r)  => assert_eq!(r.name, user.name),
        Err(r) => { println!("{:?}", r); assert!(false); }
    }
}

Supported API versions

Important Note: Kraken is deprecated and Helix (the new API version) is out of scope of this repository currently.

Endpoints Kraken/v5
Analytics
Bits ✔️
Channels ✔️
Chat ✔️
Clips ✔️
Collections ✔️
Entitlements
Games ✔️
Ingests ✔️
Moderation
Search ✔️
Streams ✔️
Subscriptions
Tags
Teams ✔️
Users ✔️
Videos ✔️
Webhooks

Links

Helpful Documentation

Token Generation

Repositories:

License

GNU LGPL-3.0-or-later; see copying.md and legal/LGPL-v3.

Dependencies

~5–10MB
~183K SLoC