I want to develop an application where registered user of my application can stream their gaming sessions on twitch. I’m able to live my gaming sessions video using: https://player.twitch.tv/?channel=myChannel
but i want to know from where i will get username or channel name of my registered user so that i can pass it to api to view live streaming.
So i will save that user_id for future use in my database,Is compulsory for user to login to twitch (in my application) before starting streaming, i was using OBS, or there is any better alternative
If they don’t login and/or register you have no information about them, so how are you supposed to get their user ID without registration and/or login with Twitch?
You can do whatever kind of login to your system that you want. And then add a “link your Twitch account” button in your profile system, or just use login to Twitch to start.
Can you please provide the link to logout after i have run following code to extract user info:
$curl = curl_init(‘https://api.twitch.tv/kraken/user’);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // Disables SSL verification
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
‘Accept: application/vnd.twitchtv.v5+json’,
'Client-ID: ’ . $client_id,
'Authorization: OAuth ’ . $result[‘access_token’]
));
$user = curl_exec($curl);
Your website? That depends on your session manager that you have for your website
The API doesn’t have a “logout” method since you never logged in.
The API has a “revoke” access key method, but generally you don’t need to use that, since you probably want to store the users access and refresh tokens in order to continue to use their access keys
I’m still login in Twitch after i am authenticated through OAuth, is there is any way to logout from twitch or logout should be manual. When i run https://www.twitch.tv/myprofile i see that i’m login.