[ComfyJS] Invalid Password or Permission Scopes (channel:read:redemptions, user:read:email)

Hello there ! :slight_smile:

I have an issue when I’m using the module ComfyJS with JavaScript, and I don’t know if you can help me on this one.

The issue begin when I want to send messages in my chat via this module.
Here is the link for the documentation : https://github.com/instafluff/ComfyJS#sending-chat-messages

So I read the documentation on github, and they say that we need to get a Twitch Chat OAuth Password Token. So I click to the link and generate a password token. Then I add it to the function ComfyJS.Init([channel-name], [oauth-password]).
And then, I add the code to send a message just to see if everything works properly, like so : ComfyJS.Say( "test" );.

But, when I look at my console, I have an error which says : Invalid Password or Permission Scopes (channel:read:redemptions, user:read:email).
And I can’t send message to my chat.

Is there anything that I have missed to make it work ? How can I fix this issue ?

Thank you so much for your help ! :slight_smile:

To send messages to chat requires chat:read/chat:edit scopes Authentication | Twitch Developers

Okay thank you very much ! But do you know how I can configure this into the module ?
Or if you don’t, how does it work to configure it ?

Thank you very much for your help ! :slight_smile:

Either figure out how to do that properly using the linked to in comfy.js’ readme


Or create your own oAuth flow

It’s not a problem with comfy but a problem with the token you generated

Okay thank you so much I will figure it out ! Thank you, I appreaciate that ! :smiley:

The problem is, I have generated the token at least 3 time, but I still have the same error and I don’t know why… I’m wondering if there is anything else to do. Or maybe I have created something, like my own app, and nothing works.

I can’t use dotenv like the editor said, but instead I put the auth code directly into the function, like so : ComfyJS.Init( "DuckenScott", 'oauth:wrk4x945pz0wfo4xjzb73xxxxxxxxx' );

I think I did nothing wrong, that’s why I’m a little bit lost, the documentation is simple but it doesn’t work… :confused:

I really thank you for your help ! :slight_smile:

Use validate to ensure that your token has what you think it has in terms of scopes

Beyond that I’m not sure how else to help you as this could be a library problem, or a problem with the instructions for that library, and I don’t use comfy.js

You may have done

And then not asked for all the scopes needed.

And your error says you don’t have enough scopes, or you only have these scopes? I don’t know without digging thru comfy’s code to see what this error actually means.

Okay so I use de command :
curl -H "Authorization: OAuth wrk4x945pz0wfo4xjzb73xxxxxxxxx" https://id.twitch.tv/oauth2/validate

into my CLI, and I have an error which say:

`Invoke-WebRequest: Unable to bind parameter "Headers". Unable to convert value "Authorization: OAuth wrk4x945pz0wfo4xjzb73xxmp34dfe" from type "System.String" to type "System.Collections.IDictionary".`

Is there anything wrong that I did ?

I didn’t done that, I only use the Comfy.Say function.

I didn’t set any scope. I only download the zip and add the comfy.min.js into my project, I didn’t set anything.

Again, thank you so much for your help ! :slight_smile:

Windows PowerShell? Thats not real curl, which is the problem, you called curl and windows ran something else.

You “set” what scopes you want when generating the token on Twitch OAuth Token Generator where as Twitch Chat Password Generator should only generate a chat capable token.

Then what/where/how did you get an oAuth token to use?

No into Visual Studio Code. Do I have to use something else ?

So the chat capable token generate channel:read:redemptions && user:read:email, is it correct ? Or do I have to generate a token with twitchapps.com/tokengen ?

I only generate a token in this url twitchapps.com/tmi and I enter the entire code into the function ComfyJS.Init() like the documentation says.

Thanks again for your awesome help ! :slight_smile:

No. Neither of those scopes allow read/write to chat

Okay so I delete an application that I have been set in my twitch dev dashboard and regenerate a new token, and now it works ! Thanks again for your awesome help ! Thank you so much ! :smiley:

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