MyBB Twitch Integration
MyBB 1.8 plugin that turns marked Twitch channel links into responsive video players. If a channel is live, the player shows the live stream. If it is offline, the plugin shows its latest archived VOD when one is available.
The plugin is intended primarily for HTML-based MyBB help documents.
Features
- Shows a live Twitch stream when the channel is online.
- Falls back to the latest archived VOD when the channel is offline.
- Keeps the original Twitch link as a fallback.
- Supports multiple streamers on one page.
- Uses MyBB's
xmlhttp.phphook instead of a separate public PHP file. - Keeps the Twitch Client Secret on the server.
- Adds its CSS and JavaScript automatically during activation.
- Makes no Twitch request on pages without marked Twitch links.
Requirements
- MyBB 1.8.x
- PHP with cURL and JSON support
- A Twitch Developer application with a Client ID and Client Secret
- Outbound HTTPS access to the Twitch OAuth and Helix APIs
Installation
Copy the contents of Upload/ into the MyBB installation root:
Upload/inc/plugins/twitch.php
-> inc/plugins/twitch.php
Upload/css/twitch.css
-> css/twitch.css
Upload/jscripts/twitch/twitch-vod-loader.js
-> jscripts/twitch/twitch-vod-loader.js
Then:
- Open Admin CP → Configuration → Plugins.
- Install and activate Twitch Integration.
- Open Admin CP → Configuration → Settings → Twitch Integration.
- Enter the Client ID and Client Secret from the Twitch Developer Console.
- Confirm the Twitch parent domains and save the settings.
Activation inserts {$twitch_assets} after {$stylesheets} in the headerinclude template. Deactivation removes it.
If an earlier development copy included twitch_vods.php in the MyBB root, remove that file. The lookup is now handled by the plugin through MyBB's xmlhttp.php hook.
Help-document markup
Place a normal Twitch channel link inside a twitch-auto wrapper:
<div class="twitch-auto">
<a href="https://www.twitch.tv/xsickprodigy">
Watch Sick Prodigy on Twitch
</a>
</div>
Add one wrapper per streamer. No iframe, fixed VOD ID, channel list, or custom data-* attribute is required.
When the page loads, the plugin:
- Extracts the channel name from each marked link.
- Checks whether each channel is live.
- Inserts the live player or latest archived VOD.
- Leaves the original link below the player.
If Twitch is unavailable, the channel is invalid, or no archived VOD exists, the original link remains unchanged.
Settings
Twitch Client ID
The Client ID assigned to the Twitch Developer application.
Twitch Client Secret
Used by PHP to request a Twitch application access token. It is not added to the page, JavaScript configuration, lookup URL, or JSON response.
Like other MyBB settings, the secret is stored in the MyBB database and settings cache. Administrators with Admin CP, database, filesystem, or backup access should be treated as trusted.
Twitch Parent Domains
Enter one allowed embed hostname per line without a protocol or path:
sickgaming.net
www.sickgaming.net
Frontend Debug Logging
Writes failed lookup details to the browser console. Credentials and access tokens are not logged by the frontend.
Lookup endpoint
The loader sends a same-origin request through MyBB:
/xmlhttp.php?action=twitch_lookup&channels=xsickprodigy,anotherchannel
The plugin validates and deduplicates channel names, accepts up to 10 channels per request, obtains or reuses a cached Twitch application token, checks live status, and requests the latest archived VOD for offline channels.
Example response:
{
"xsickprodigy": {
"type": "vod",
"channel": "xsickprodigy",
"video_id": "1234567890"
}
}
The endpoint is public because help documents may be viewed by guests, but it never returns the configured Twitch credentials or application token.
Manual template integration
If a customized headerinclude template does not contain {$stylesheets}, add this variable manually:
{$twitch_assets}
Troubleshooting
- Link appears but no player: Confirm the wrapper uses
class="twitch-auto", the URL points to a Twitch channel, and the plugin assets appear in the page source. - HTTP 503: The Client ID or Client Secret has not been configured.
- HTTP 502: Verify the Twitch credentials, PHP cURL support, outbound HTTPS access, and Twitch API availability.
- Twitch rejects the embed: Confirm the current hostname is listed under Twitch Parent Domains.
- Offline channel has no player: The channel does not currently have an archived broadcast. Highlights, clips, and uploads are not used as fallbacks.
Uninstall
Deactivation removes the template insertion but preserves settings. Uninstalling removes the plugin setting group and rebuilds MyBB's settings cache. Uploaded plugin, CSS, and JavaScript files must be removed manually if they are no longer needed.
License
Copyright (C) 2026 SickProdigy. Licensed under GPL-3.0-only.