twitch_highway
A Rust library for the Twitch API with compile-time safety and comprehensive response support.
- Comprehensive Twitch Helix API endpoint support
- Type-safe IDs and request builders (BroadcasterId, ModeratorId, etc.)
- Detailed error handling (API, network, and JSON parsing errors)
- EventSub Webhook verification with framework integrations (axum, actix-web)
- EventSub WebSocket client with automatic reconnection and routing
Quick Start
[]
# Add the endpoints you need: "chat", "users", etc.
= { = "0.3", = ["moderation"] }
= { = "1", = ["full"] }
= { = "0.1", = ["oauth"] }
# or
# twitch_oauth_token = { version = "2" }
use ;
// or
// use twitch_oauth_token::oauth::{AccessToken, ClientId};
use ;
async
EventSub Support
Webhook Verification (axum)
[]
= { = "0.3", = ["eventsub", "webhook-axum"] }
= "0.8"
use ;
use ;
async
let app = new.route;
WebSocket Client
[]
= { = "0.3", = ["eventsub", "websocket"] }
use ;
async
async = new.route;
client.await?;
Ok
}
Feature Flags
Enable only the API modules you need:
- ads
- analytics
- bits
- ccls
- channel-points
- channels
- charity
- chat
- clips
- conduits
- entitlements
- extensions
- eventsub
- games
- goals
- guest-star
- hype-train
- moderation
- polls
- predictions
- raid
- schedule
- search
- streams
- subscriptions
- teams
- users
- videos
- whisper
- full
EventSub Features
webhook: All webhook features (verification, framework integrations)webhook-verify: Core signature verificationwebhook-axum: Axum framework integrationwebhook-actix: Actix-web framework integrationwebsocket: WebSocket client with routingwebsocket-client: WebSocket client onlywebsocket-router: Event router with middleware
License
Licensed under either of
- Apache License, Version 2.0
- MIT license