twitch_api

Crates.iotwitch_api
lib.rstwitch_api
version0.7.0-rc.8
sourcesrc
created_at2017-04-03 20:55:26.107316
updated_at2024-10-11 18:22:50.326257
descriptionLibrary for talking with the new Twitch API aka. "Helix", EventSub and more!
homepage
repositoryhttps://github.com/twitch-rs/twitch_api
max_upload_size
id9531
size1,728,554
nerix (Nerixyz)

documentation

https://docs.rs/twitch_api/0.7.0-rc.8

README

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

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.
Commit count: 1215

cargo fmt