Skip to content

Instantly share code, notes, and snippets.

@the-vampiire
Created April 24, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-vampiire/09bbad3c564d745da4b14310e00815dc to your computer and use it in GitHub Desktop.
Save the-vampiire/09bbad3c564d745da4b14310e00815dc to your computer and use it in GitHub Desktop.
Twitch JS SDK Authentication
// Document Ready (execute on page load completion)
$( function(){
// Twitch JS SDK looks for authenticated login status
Twitch.init({clientId: 'YOUR CLIENT ID HERE'}, function(error, status) {
if (status.authenticated) {
// Already logged in, hide button
$('.twitch-connect').hide();
// call logged in user conversion passing the OAuth Token
convert_username_OAuth(status.token);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment