A comprehensive Go client library for the Kick.com API. GoKICK provides a type-safe, idiomatic Go interface to interact with Kick's streaming platform, including authentication, channels, chat, moderation, livestreams, and webhooks.
- π Complete OAuth2 Authentication - User and app access token management with automatic token refresh
- πΊ Channel Management - Get channels, update stream metadata, manage channel rewards
- π¬ Chat Operations - Send and delete chat messages
- π‘οΈ Moderation Tools - Ban and unban users
- π Livestream Data - Get livestreams and statistics
- π Kicks & Rewards - Access leaderboards and manage channel rewards
- π Webhook Events - Subscribe to and handle webhook events
- π·οΈ Categories & Users - Browse categories and user information
- π Auto Token Refresh - Automatic user token refresh with callback support
- π§ͺ Well Tested - Comprehensive test coverage
go get github.com/scorfly/gokickpackage main
import (
"context"
"fmt"
"github.com/scorfly/gokick"
)
func main() {
// Create a client with app access token
client, err := gokick.NewClient(&gokick.ClientOptions{
AppAccessToken: "your-app-access-token",
})
if err != nil {
panic(err)
}
// Get categories
categories, err := client.GetCategories(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("Found %d categories\n", len(categories.Result))
}// 1. Get authorization URL
client, _ := gokick.NewClient(&gokick.ClientOptions{
ClientID: "your-client-id",
})
authURL, _ := client.GetAuthorize(
"http://localhost:3000/oauth/kick/callback",
"state-value",
"code-challenge",
[]gokick.Scope{gokick.ScopeUserRead, gokick.ScopeChannelRead},
)
// 2. Redirect user to authURL, then exchange code for token
client, _ = gokick.NewClient(&gokick.ClientOptions{
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
})
token, _ := client.GetToken(
context.Background(),
"http://localhost:3000/oauth/kick/callback",
"authorization-code",
"code-verifier",
)
// 3. Use the token
client.SetUserAccessToken(token.AccessToken)client, _ := gokick.NewClient(&gokick.ClientOptions{
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
UserAccessToken: "current-access-token",
UserRefreshToken: "refresh-token",
})
// Set callback to save new tokens when refreshed
client.OnUserAccessTokenRefreshed(func(accessToken, refreshToken string) {
// Save tokens to your storage
fmt.Printf("Tokens refreshed: %s\n", accessToken)
})
// Client will automatically refresh expired tokens
channels, err := client.GetChannels(context.Background(), gokick.NewChannelListFilter())See the documentation directory for detailed examples and supported endpoints:
- Authentication - OAuth2 flows, token management
- Channels - Channel operations and rewards
- Chat - Send and manage chat messages
- Moderation - Ban/unban users
- Livestreams - Get livestream data and stats
- Users - User information and token introspection
- Categories - Browse categories
- Kicks - Kicks leaderboard
- Events - Webhook event subscriptions
- Webhook Events - Webhook payload structures
GoKICK supports a comprehensive set of Kick API endpoints:
- β Authentication - Authorization, token exchange, refresh, revoke, app tokens
- β Categories - List and get category details
- β Users - Get users, token introspection
- β Channels - Get channels, update stream metadata, manage rewards
- β Chat - Send and delete messages
- β Moderation - Ban and unban users
- β Livestreams - Get livestreams and statistics
- β Public Key - Get public key for webhook verification
- β Kicks - Get kicks leaderboard
- β Events - Subscribe to webhook events
See the full feature list for complete details.
make testmake lint- Go 1.25.5 or later
For official Kick API documentation, see the KICK Developer website.
This package is distributed under the terms of the MIT license.
