OAuth Connector for Twitch.tv - PHP

Description
// NEWS: OCTOBER 2026:聽Still works!
Our OAuth Connector takes care of the authentication process, freeing you to focus on coding. We've also included a sample function to demonstrate its use, which can be easily modified to suit your specific needs, accelerating your development process.
The Connector retrieves and refreshes OAuth tokens using your provided client ID and client secret. We've included a guide on how to obtain these from Twitch.
Please note, this OAuth Connector is designed for obtaining 'app access tokens' only. Before proceeding, ensure your planned functionalities only require an 'app access token'. To verify this, check the 'Authorization' section of the function you're implementing on the Twitch API reference page: https://dev.twitch.tv/docs/api/reference/
For instance, the 'Get Videos' function accepts both 'app access token' and 'user access token', which means this function can be implemented using our OAuth Connector: https://dev.twitch.tv/docs/api/reference/#get-videos
The "PHP OAuth Connector for Twitch.tv API" isn't endorsed by Twitch or Amazon and doesn't reflect the views or opinions of Twitch or anyone officially involved in producing or managing Twitch or Amazon.
Features
- easy to use and provides you a head-start for your development
- sample function included
- automatically gets the OAUTH token after first script runtime
- automatically refreshes the twitch OAUTH token (expires every 60 days)
Requirements
- PHP knowledge
- PHP Version: at least version 8.0 - higher is recommended
- Server needs to have permissions to read and write to the config-File
- cURL needs to be enabled in the php.ini / allowed on the server
Instructions
You will also get all Instructions in the README file after your purchase!
In general you have to do these steps:
1: Register your app at Twitch Developer to obtain a client ID and client secret
2: Paste your Client ID and Client Secret into the config.ini file into the according keys
3: Download the package, extract it and copy the files into the folder of your website / webapp
4: Use the following code to try out the OAuth Connector and the sample function to get a working response from the Twitch API
try {
// Instantiate a new TwitchApi object. Make sure to provide the correct path to the 'config.ini' file.
$twitchApi = new TwitchApi(__DIR__ . '/path/config.ini');
// Call the getID() function and pass the name of the Twitch user whose ID you want to retrieve.
$id = $twitchApi->getID('LIRIK');
// echo the Streamer and his Twitch ID
echo "LIRIK - ID: " . $id;
} catch (Exception $e) {
// If something goes wrong, the script will catch the exception and print its message.
echo "We encountered an issue. Please refresh or try it again later.";
}
5: Use the included sample function (getID) as your starting point to easily develop your own functions and quickly develop your needed functionalities!
| Author | Fragxz |
|---|---|
| Category | Scripts & Code / PHP Scripts / Social Networking |
| Price | $9 |
| Extended License | $27 |
| Likes | 3 |
| First Release | Jun 27, 2023 |
| Last Update | Jun 27, 2023 |
| Software version | PHP 8.0, PHP 8.1, PHP 8.2, PHP 8.3, PHP 8.4 |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit馃
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website 路 12,847 views 路 46 clicksWebsite 路 Week 49 路 12,847 views 路 46 clicks
馃
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website 路 7,964 views 路 10 clicksWebsite 路 Week 49 路 7,964 views 路 10 clicks
馃
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website 路 15,624 views 路 28 clicksWebsite 路 Week 49 路 15,624 views 路 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website 路 7,784 views 路 2 clicksWebsite 路 Week 49 路 7,784 views 路 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website 路 7,679 views 路 4 clicksWebsite 路 Week 49 路 7,679 views 路 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website 路 7,591 views 路 0 clicksWebsite 路 Week 49 路 7,591 views 路 0 clicks