twitch_api2

Crates.iotwitch_api2
lib.rstwitch_api2
version0.6.1
sourcesrc
created_at2020-08-10 22:37:10.411298
updated_at2022-04-29 08:14:10.368515
descriptionLibrary for talking with the new Twitch API aka. "Helix", TMI and more!
homepage
repositoryhttps://github.com/Emilgardis/twitch_api2
max_upload_size
id275172
size1,187,810
Emil Gardström (Emilgardis)

documentation

https://docs.rs/twitch_api2/0.6.1

README

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

cargo fmt