#twitch #oauth #api #async #api-client

twitch_api2

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

14 releases

0.6.1 Apr 29, 2022
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

#1855 in Web programming

Download history 33/week @ 2023-12-03 85/week @ 2023-12-10 55/week @ 2023-12-17 30/week @ 2023-12-24 6/week @ 2023-12-31 74/week @ 2024-01-07 38/week @ 2024-01-14 36/week @ 2024-01-21 44/week @ 2024-01-28 39/week @ 2024-02-04 94/week @ 2024-02-11 181/week @ 2024-02-18 116/week @ 2024-02-25 72/week @ 2024-03-03 110/week @ 2024-03-10 147/week @ 2024-03-17

455 downloads per month
Used in 4 crates

MIT/Apache

1MB
19K 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

~2–21MB
~342K SLoC