#oauth #twitch #async #asynchronous #api

twitch_api2

Library for talking with the new Twitch API aka. “Helix”, TMI and more!

12 unstable releases (5 breaking)

0.6.0-rc.3 Sep 27, 2021
0.6.0-rc.1 Jul 14, 2021
0.5.0-alpha.5 Feb 27, 2021
0.5.0-alpha.2 Nov 1, 2020

#3 in #twitch

Download history 52/week @ 2021-08-14 79/week @ 2021-08-21 2/week @ 2021-08-28 2/week @ 2021-09-04 24/week @ 2021-09-11 18/week @ 2021-09-18 18/week @ 2021-09-25 40/week @ 2021-10-02 32/week @ 2021-10-09 27/week @ 2021-10-16 45/week @ 2021-10-23 11/week @ 2021-10-30 34/week @ 2021-11-06 10/week @ 2021-11-13 17/week @ 2021-11-20 29/week @ 2021-11-27

96 downloads per month
Used in 4 crates

MIT/Apache

1MB
18K SLoC

Twitch API2 | Rust library for talking with the new Twitch API aka. "Helix", TMI and more!

githubcrates-iodocs-rs-big

See documentation for more info.

You can see current unpublished docs here: local-docs

See examples for examples.

use twitch_api2::helix::HelixClient;
use twitch_oauth2::{AccessToken, UserToken};
use reqwest::Client as ReqwestClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
  let client: HelixClient<ReqwestClient> =  HelixClient::default();

    let token = UserToken::from_existing(
        &client,
        AccessToken::new("mytoken".to_string()),
        None, // Refresh Token
        None, // Client Secret
    )
    .await?;

    println!("Channel: {:?}",
            client.get_channel_from_login("twitchdev", &token).await?
    );

    Ok(())
}

Goals

This crate aims to target

This crate should also be able to be used for

There are no current plans to support

License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.1–6MB
~130K SLoC

5Ra