Need urgent help in twitch integration for my website

Hi,

I want to integrate twitch in my own website.

I have already followed all the documentations in the following links :
a) https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#oauth-client-credentials-flow
b) https://dev.twitch.tv/docs/api/
c) https://discuss.dev.twitch.com/ (Also checked the twitch forum)

And I have already tried generating Token using API but I am not getting proper response all the time.

Now my request to you is that please guide me where I am doing wrong or please help me step by step. If there is any link for the documentation please send me also.

NB : My application is in angular.js and if there is any package available then please help me in proving that too.

what code did you try and what message are you getting?

When you say “integrate Twitch in your website” what are you actually trying to do?

First, thank you for your quick reply.

I want to integrate an api (like https://dev.twitch.tv/docs/api/) means I want to call this simple api to test whether the api response is coming or not (i.e https://api.twitch.tv/helix/search/channels?query=a_seagull) ?

To call this simple api I need to generate a token. To generate the token I have tried to call ’
https://id.twitch.tv/oauth2/token` but can not generate the token. So can you please tell me how can I call those simple api for twitch.

You just need to make a single POST HTTP request to generate a client credentials token

heres a nodeJS server side example using Got

As you mentioned this is for an Angular app, just to make things clear, you should NOT use the client credentials flow in the front end. It is ONLY for use side-server as it requires credentials that should never be exposed to the frontend user.

If you intend to make API requests client-side (such as in the Angular app) use the Implicit auth flow https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-implicit-code-flow where you send the user to Twitch, they accept your app, and are redirected back to your site with a token.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.