Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Kappopher
<p align="center">
<img src="docs/assets/images/logo.png" alt="Kappopher" width="180">
</p>

[![Go Reference](https://pkg.go.dev/badge/github.com/Its-donkey/kappopher.svg)](https://pkg.go.dev/github.com/Its-donkey/kappopher)
[![Go Report Card](https://goreportcard.com/badge/github.com/Its-donkey/kappopher)](https://goreportcard.com/report/github.com/Its-donkey/kappopher)
[![Tests](https://github.com/Its-donkey/kappopher/actions/workflows/test.yml/badge.svg)](https://github.com/Its-donkey/kappopher/actions/workflows/test.yml)
[![Coverage](https://raw.githubusercontent.com/Its-donkey/kappopher/main/.github/coverage.svg)](https://github.com/Its-donkey/kappopher/actions/workflows/test.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Go Version](https://img.shields.io/github/go-mod/go-version/Its-donkey/kappopher)](https://github.com/Its-donkey/kappopher)
<h1 align="center">Kappopher</h1>

<p align="center">
<a href="https://pkg.go.dev/github.com/Its-donkey/kappopher"><img src="https://pkg.go.dev/badge/github.com/Its-donkey/kappopher.svg" alt="Go Reference"></a>
<a href="https://goreportcard.com/report/github.com/Its-donkey/kappopher"><img src="https://goreportcard.com/badge/github.com/Its-donkey/kappopher" alt="Go Report Card"></a>
<a href="https://github.com/Its-donkey/kappopher/actions/workflows/test.yml"><img src="https://github.com/Its-donkey/kappopher/actions/workflows/test.yml/badge.svg" alt="Tests"></a>
<a href="https://github.com/Its-donkey/kappopher/actions/workflows/test.yml"><img src="https://raw.githubusercontent.com/Its-donkey/kappopher/main/.github/coverage.svg" alt="Coverage"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://github.com/Its-donkey/kappopher"><img src="https://img.shields.io/github/go-mod/go-version/Its-donkey/kappopher" alt="Go Version"></a>
</p>

A comprehensive Twitch API toolkit for Go.

Expand All @@ -25,6 +31,8 @@ A comprehensive Twitch API toolkit for Go.
- **Rate Limiting**: Automatic rate limit tracking with retry support
- **Type-Safe**: Fully typed request/response structures with Go generics

**[View Full Documentation and a complete cookbook of examples](https://its-donkey.github.io/kappopher/)**

## Installation

```bash
Expand Down Expand Up @@ -70,20 +78,6 @@ func main() {
- [Quick Start Guide](./docs/quickstart.md) - Installation, authentication, and basic usage
- [API Reference](./docs/README.md) - Full endpoint documentation

## Comparison

| Feature | Kappopher | Other Helix wrappers |
|---------|-----------|----------------------|
| IRC/TMI Chat | Yes | Varies |
| EventSub WebSocket | Yes | No |
| EventSub Conduits | Yes | Varies |
| PubSub Compatibility Layer | Yes | No |
| Middleware System | Yes | No |
| Caching Layer | Yes | No |
| Batch Operations | Yes | No |
| All OAuth Flows | Yes | Partial |
| Extension JWT | Full | Basic |

## License

MIT License - see [LICENSE](./LICENSE) for details.
Expand Down
4 changes: 4 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-remote-theme"
40 changes: 27 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ This documentation provides detailed guides and examples for using the Twitch He
## Table of Contents

- [Quick Start](quickstart.md) - Installation, basic usage, authentication, and error handling
- [Available Endpoints](#available-endpoints) - All API methods
- [Helix API](#helix-api) - All API endpoints
- [IRC Client](#irc-client) - Real-time chat for bots
- [Advanced Features](#advanced-features) - Batch operations, caching, EventSub
- [Examples](#examples) - Working code samples

## Available Endpoints
## Helix API

| Category | Documentation |
|----------|---------------|
| [Ads](ads.md) | Start commercials, manage ad schedules |
| [Analytics](analytics.md) | Extension and game analytics |
| [Auth](auth.md) | OAuth flows, token management, OIDC |
| [Bits](bits.md) | Bits leaderboard, cheermotes |
| [Channel Points](channel-points.md) | Custom rewards, redemptions |
| [Channels](channels.md) | Channel info, followers, editors, VIPs |
| [Channel Points](Projects/Programming/Kappopher/Documents/channel-points.md) | Custom rewards, redemptions |
| [Channels](Projects/Programming/Kappopher/Documents/channels.md) | Channel info, followers, editors, VIPs |
| [Charity](charity.md) | Charity campaigns and donations |
| [Chat](chat.md) | Chatters, emotes, badges, settings, messages |
| [Clips](clips.md) | Create and get clips |
| [CCL](ccl.md) | Content classification labels |
| [Conduits](conduits.md) | EventSub conduit management |
| [Entitlements](entitlements.md) | Drops entitlements |
| [EventSub](eventsub.md) | Event subscriptions |
| [PubSub Compatibility](pubsub-compat.md) | PubSub-style API backed by EventSub |
| [Extensions](extensions.md) | Extension management |
| [Games](games.md) | Game information |
| [Goals](goals.md) | Creator goals |
Expand All @@ -45,14 +45,28 @@ This documentation provides detailed guides and examples for using the Twitch He
| [Videos](videos.md) | VODs, highlights, uploads |
| [Whispers](whispers.md) | Send whisper messages |

## IRC Client

| Category | Documentation |
|----------|---------------|
| [IRC Client](Projects/Programming/Kappopher/Documents/irc-client.md) | WebSocket-based chat client for building bots |

## Advanced Features

| Category | Documentation |
|----------|---------------|
| [EventSub](eventsub.md) | Event subscriptions (WebSocket & Webhooks) |
| [PubSub Compatibility](pubsub-compat.md) | PubSub-style API backed by EventSub |
| [Advanced](advanced.md) | Batch operations, rate limiting, caching, middleware |

## Examples

See the [examples](./examples/) directory for code samples:

- [Basic Usage](./examples/basic.md) - Simple API calls and error handling
- [Chat Bot](./examples/chatbot.md) - Building a chat bot
- [API Usage](./examples/api-usage.md) - Common API patterns
- [EventSub Webhooks](./examples/eventsub-webhooks.md) - Webhook notifications
- [EventSub WebSocket](./examples/eventsub-websocket.md) - Real-time events
- [PubSub Migration](./examples/pubsub-migration.md) - Migrating from PubSub to EventSub
- [Extension JWT](./examples/extension-jwt.md) - Extension authentication
- [Basic Usage](basic.md) - Simple API calls and error handling
- [Chat Bot](chatbot.md) - Building a chat bot
- [API Usage](api-usage.md) - Common API patterns
- [EventSub Webhooks](eventsub-webhooks.md) - Webhook notifications
- [EventSub WebSocket](eventsub-websocket.md) - Real-time events
- [PubSub Migration](pubsub-migration.md) - Migrating from PubSub to EventSub
- [Extension JWT](Projects/Programming/Kappopher/Documents/examples/extension-jwt.md) - Extension authentication
31 changes: 31 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: Kappopher
description: A comprehensive Go wrapper for the Twitch Helix API
url: "https://its-donkey.github.io"
baseurl: "/kappopher"

# Syntax highlighting
highlighter: rouge
markdown: kramdown
kramdown:
syntax_highlighter: rouge
input: GFM

# Default front matter for all pages
defaults:
- scope:
path: ""
values:
layout: "default"
- scope:
path: "examples"
values:
layout: "default"

# Exclude files
exclude:
- General.html
- "*.sh"
- Gemfile
- Gemfile.lock
- node_modules
- vendor
77 changes: 77 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}</title>
<meta name="description" content="{{ page.description | default: site.description }}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
</head>
<body>
<nav class="navbar">
<div class="nav-container">
<a href="{{ '/' | relative_url }}" class="nav-brand">
<img src="{{ '/assets/images/logo.png' | relative_url }}" alt="Kappopher" class="brand-logo">
<span class="brand-text">{{ site.title }}</span>
</a>
<div class="nav-links">
<a href="{{ '/' | relative_url }}" class="nav-link{% if page.url == '/' %} active{% endif %}">Home</a>
<a href="{{ '/quickstart' | relative_url }}" class="nav-link{% if page.url contains 'quickstart' %} active{% endif %}">Quick Start</a>
<a href="{{ '/api-reference' | relative_url }}" class="nav-link{% if page.url contains 'api-reference' or page.url contains '.md' and page.url != '/' %} active{% endif %}">API Reference</a>
<a href="{{ '/cookbook' | relative_url }}" class="nav-link{% if page.url contains 'cookbook' or page.url contains 'examples' %} active{% endif %}">Cookbook</a>
<a href="https://github.com/Its-donkey/kappopher" class="nav-link nav-github" target="_blank">
<svg height="20" width="20" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
</svg>
</a>
</div>
<button class="nav-toggle" aria-label="Toggle navigation">
<span></span>
<span></span>
<span></span>
</button>
</div>
</nav>

<main class="main-content">
<div class="content-container">
{% if page.title and page.url != '/' %}
<header class="page-header">
<h1>{{ page.title }}</h1>
{% if page.description %}
<p class="page-description">{{ page.description }}</p>
{% endif %}
</header>
{% endif %}

<article class="content">
{{ content }}
</article>
</div>
</main>

<footer class="footer">
<div class="footer-container">
<div class="footer-content">
<p>Built with Jekyll for GitHub Pages</p>
<p class="footer-links">
<a href="https://github.com/Its-donkey/kappopher">GitHub</a>
<span class="separator">|</span>
<a href="https://pkg.go.dev/github.com/Its-donkey/kappopher">Go Docs</a>
</p>
</div>
</div>
</footer>

<script>
// Mobile navigation toggle
document.querySelector('.nav-toggle').addEventListener('click', function() {
document.querySelector('.nav-links').classList.toggle('active');
this.classList.toggle('active');
});
</script>
</body>
</html>
26 changes: 24 additions & 2 deletions docs/ads.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# Ads API
---
layout: default
title: Ads API
description: Manage commercial breaks and ad schedules for Twitch channels.
---

Manage commercial breaks and ad schedules for Twitch channels.
## Overview

Control advertising on your Twitch channel programmatically:

**Commercial Breaks**: Run ads during your stream
- Start commercials of various lengths (30-180 seconds)
- Check cooldown before next commercial

**Ad Schedule**: Manage automatic ad scheduling
- View upcoming scheduled ads
- Check preroll-free time remaining
- Snooze scheduled ads (limited per stream)

## Prerequisites

- **Start Commercial:** `channel:edit:commercial` scope
- **Ad Schedule (read):** `channel:read:ads` scope
- **Ad Schedule (manage):** `channel:manage:ads` scope

## StartCommercial

Expand Down Expand Up @@ -99,3 +120,4 @@ for _, schedule := range resp.Data {
]
}
```

Loading