Client ID and OAuth token do not match

This suggest that you didn’t define the access token.

If your intent is to only obtain public data.

Then you should set your redirect URI to http://localhost/.

Then generate a server to server / client credentials token

Documentation: Getting OAuth Access Tokens | Twitch Developers

NodeJS Example: https://github.com/BarryCarlyon/twitch_misc/tree/master/authentication/app_access_tokens/nodejs

Then you can pass in the access token from your generator to your channel search function you have pasted

Just make sure you are doing this all on the backend, not the frontend, as frontend will leak your client secret and generated token(s)

This example is for User Authentication, and you wouldn’t be using user authentication (or passportJS) for the purpose of just checking public data.

So depends what you end goal is here.

1 Like