Twitch helix getting online or offline status

And there is not other ways to do it right? Because I saw other things on the internet as well with “kraken” like this:

"
(function() {
var user_name, api_key, twitch_widget;

  user_name = "name";
  api_key = "api key here";
  twitch_widget = $("#nametv_twitch-widget");

  twitch_widget.attr("href","https://twitch.tv/" + user_name);

  $.getJSON('https://api.twitch.tv/kraken/streams/' + user_name + '?client_id=' + api_key + '&callback=?', function(data) {	
      if (data.stream) {
          twitch_widget.html("<span class='online'></span> " + data.stream.viewers);
      } else {
          twitch_widget.html(" OFFLINE");
      }  
  });
})();

"