#twitch #oauth #async

twitch_api

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

7 releases

0.7.0-rc.7 Sep 17, 2023
0.7.0-rc.6 May 1, 2023
0.7.0-rc.4 Jan 21, 2023
0.7.0-rc.3 Dec 19, 2022
0.1.1 Apr 3, 2017

#245 in Web programming

Download history 35/week @ 2023-12-11 19/week @ 2023-12-18 68/week @ 2023-12-25 80/week @ 2024-01-01 106/week @ 2024-01-08 23/week @ 2024-01-15 33/week @ 2024-01-22 8/week @ 2024-01-29 154/week @ 2024-02-05 68/week @ 2024-02-12 107/week @ 2024-02-19 93/week @ 2024-02-26 118/week @ 2024-03-04 33/week @ 2024-03-11 182/week @ 2024-03-18 80/week @ 2024-03-25

423 downloads per month

MIT/Apache

1.5MB
25K SLoC

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

githubcrates-iodocs-rs-bigdiscord

See documentation for more info.

You can see current unpublished docs for the main branch here: local-docs

See examples for examples. If you want to run them locally, make sure you get the git submodules first.

use twitch_api::helix::HelixClient;
use twitch_api::twitch_oauth2::{AccessToken, UserToken};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
    // Create the HelixClient, which is used to make requests to the Twitch API
    let client: HelixClient<reqwest::Client> = HelixClient::default();
    // Create a UserToken, which is used to authenticate requests
    let token = UserToken::from_token(&client, AccessToken::from("mytoken")).await?;

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

    Ok(())
}

Notes

This crate was previously available as twitch_api2 and has since been renamed to twitch_api

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–22MB
~354K SLoC