Skip to content

Commit

Permalink
Update migrate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dnsge committed Mar 18, 2024
1 parent 9983524 commit acba2eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MIGRATE_FROM_V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ Multiple breaking changes were made to the API while creating version 2 of `twit
- `Handler.VerifyChallenge` takes `context.Context`
- `Handler.OnDuplicateNotification` takes `context.Context`
- `Credientials` interface takes `context.Context`
- Event handlers now have the following signature:
```go
type EventHandler[EventMessage any] func(headers bindings.NotificationHeaders, sub bindings.Subscription, event EventMessage)
```

## New:
- `TrackerFunc` wrapper helper
- `Handler` handler functions are now generated from the struct definition
- `Handler` now has `BeforeHandleEvent` to trigger logic before dispatching the appropriate event handler
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ client.Subscribe(context.Background(), &eventsub.SubRequest{
1. See [examples/sub_client/main.go](examples/sub_client/main.go) for an example usage of creating a new webhook subscription.
2. See [examples/sub_handler/main.go](examples/sub_handler/main.go) for an example usage of receiving webhook notifications from Twitch.

## Migrating to v2

See [MIGRATE_FROM_V1.md](MIGRATE_FROM_V1.md) for details on the differences between v1 and v2.

[doc-img]: https://pkg.go.dev/badge/github.com/dnsge/twitch-eventsub-framework/v2
[doc]: https://pkg.go.dev/github.com/dnsge/twitch-eventsub-framework/v2
[ci-img]: https://github.com/dnsge/twitch-eventsub-framework/actions/workflows/go.yml/badge.svg?branch=v2
Expand Down

0 comments on commit acba2eb

Please sign in to comment.