Know if I'm streaming using Axios & ReactJS

I’ve already tried this :

componentDidMount() {
    this.getTwitchData()
}

With this :

getTwitchData = () => {
    axios.defaults.headers.common["Client-ID"] = 'xxx';
    axios
      .get("https://api.twitch.tv/helix/streams?user_login=username")
      .then(response => {
        console.log(response.data);

        console.log(response.data.length);
      })
      .catch(error => {
        console.log(error);
      });
  }

And I’m getting 401 error. I understood that I need a token or something but this is it …