This repository provides integrations for Twitch's EventSub for actix-web and axum based on twitch-api.
- Ergonomic extractors
- Builtin verification
- Custom duplication checking (for example with redis - actix example)
- Multiple types on one endpoint (actix-web only)
You can test the endpoints using the Twitch's official CLI (v1.1.7 and up, GitHub Repo).
Run the example with
cargo r --example basic-actix
To test, use the twitch-cli:
twitch event verify add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
twitch event trigger add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
Run the example with
cargo r --example multiple-actix
To test, use the twitch-cli:
twitch event verify update-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
twitch event verify add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
twitch event trigger update-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
twitch event trigger add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
Run the example with
cargo r --example basic-actix
To test, use the twitch-cli: Trigger a regular event:
twitch event trigger channel.channel_points_custom_reward_redemption.add -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
Copy the event-id and retrigger the evenet:
twitch event retrigger -i {EVENT_ID} -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
Run the example with
cargo r --example basic-axum
To test, use the twitch-cli:
twitch event verify add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba
twitch event trigger add-redemption -F http://127.0.0.1:8080/eventsub -s 5f5f121fc807a21bab4209b2f34e90932778f12c099ca3ca17ee00afd0b328ba