Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature evensub #58

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

AntanasGa
Copy link

appending event sub or replacing pubsub

@instafluff instafluff marked this pull request as ready for review May 5, 2024 17:58
app.js Outdated
* @returns { string | null }
*/
async function fetchClientIdIfValidAsync( password ) {
const requiredScopes = [ "channel:read:redemptions", "user:read:email" ];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this optionally definable so that it can support more than redemptions too?

}
}

const ws = typeof window !== "undefined"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be good to be able to have this websocket available outside of the function or to return it after the connect completes to be able to call it and disconnect or do other things with it. What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we planning on using it outside point rewards?

https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#revocation-message

IMPORTANT By default, you have 10 seconds from the time you receive the Welcome message to subscribe to an event, unless otherwise specified when connecting. If you don’t subscribe within this timeframe, the server closes the connection.

I'm not sure if that applies to first subscription or the entire lifecycle

i think it would be reasonable to return the obscured onDisconnect function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants