Skip to content

Links in Websockets.md are dead #9

Open

Description

@francislavoie

See https://github.com/StreamElements/api-docs/blob/main/docs/Websockets.md, the link at the top, and the links in the socket.on comments are all broken.

Activity

  1. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    Unfortunately, this documentation is outdated and completely abandoned.
    A new documentation try can be seen in https://docs.streamelements.com. It doesn't have the API nor socket.io instructions so far, but it is more open for suggestions and improvements (it accepts issues and pull requests).

    The events can be found here:
    https://docs.streamelements.com/overlays/custom-widget-events

  2. francislavoie commented on Oct 8, 2024

    @francislavoie
    Author

    Ah, you mean https://docs.streamelements.com/websockets ?

    Shouldn't the old one be taken offline then? That's all I could find from some google searches.

    I'm not looking to write an overlay/widget. What I'm looking for is documentation on writing a tool which can get real-time events from a channel's tips/bits (to write a Discord bot which writes information about the event to a particular channel, but that part isn't relevant to this)

  3. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    Ah, you mean https://docs.streamelements.com/websockets ?

    Shouldn't the old one be taken offline then? That's all I could find from some google searches.

    I'm not looking to write an overlay/widget. What I'm looking for is documentation on writing a tool which can get real-time events from a channel's tips/bits (to write a Discord bot which writes information about the event to a particular channel, but that part isn't relevant to this)

    Well, you can use Astro Websockets or Socket.io. They are different implementations. Astro Websockets is still in development, whereas the socket.io version shouldn't receive anything new probably (it still uses version 2.x of socket.io).
    Probably the dev page will be removed (or replaced) once the documentation on the docs page is finished (the docs page doesn't have any information about API endpoints, for example).

  4. francislavoie commented on Oct 8, 2024

    @francislavoie
    Author

    In that case, could you please document what the topics look like for tips/bits/subs? I'd much rather use the new thing rather than the old thing (plus I'd rather not depend on socket.io)

  5. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    According to the documentation, channel.activities should be enough. Then you can filter it checking data.type.

  6. francislavoie commented on Oct 8, 2024

    @francislavoie
    Author

    The list of types aren't documented though.

  7. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    Yeah, Astro websockets development is still in progress, so the documentation should lack some info as well. But you can try something like follow, subscriber, tip, cheer, raid and check if they work for you.

  8. francislavoie commented on Oct 8, 2024

    @francislavoie
    Author

    I don't see how I could test without receiving real events though. I can't reasonably send tips every time I need to test. If the documentation had examples, I could simply write mocks to test the other end of my code.

  9. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    Yeah, I agree with you about the examples and the lack of info on the documentation. Just to be clear, I'm not part of the staff, I'm just a user like you, ok?!

    Well, as regards to test, you have some options, the easiest one is going to your overlays (https://streamelements.com/dashboard/overlays), create an empty one (or editing an existent one) and Emulate the event you want. Just remember to keep the option "Preview LIVE on stream" checked. Once you emulate it, it will appear for you on the websockets connection.

    I can try to look for a way to trigger test events on Astro Websockets, if I find anything I will send it here.

  10. c4ldas commented on Oct 8, 2024

    @c4ldas
    Contributor

    To trigger test events on Astro (sub, follow, tip, etc), you can use the info below:

    Request type: POST

    URL: https://api.streamelements.com/kappa/v2/activities/ACCOUNT_ID/mock

    Headers:
    Accept: application/json
    Content-Type: application/json
    Authorization: Bearer JWT_TOKEN

    Body:
    (I tried to put all possible values, but some of them are not needed for some types. I.e.: amount, tier, gifted, message and sender are not needed for follower events for obvious reasons)

    {
      "provider": "twitch",
      "isMock": true,
      "type": "subscriber",
      "data": {
        "username": "usertest",
        "amount": 1,
        "tier": "3000"              // 1000, 2000, 3000 or prime (Tier 1, 2 and 3, respectively)
        "message": "Test message",  // User message from resub or cheers
        "gifted": true,             // Only when using for gifted subscription
        "sender": "johnny"          // only when using for gifted subscription
        "avatar": "https://a.png"   // Optional, user avatar
        "displayName": "userTest"   // Optional, displayed username
      }
    }

    type must be one of below:
    follow, tip, sponsor, superchat, host, raid, subscriber, cheer, redemption, merch, fan, supporter, follower, stars, share, videolike, sparks, elixir, purchase, communityGiftPurchase, charityCampaignDonation, giveaway.

    Let me know if you need any help ;)

  11. francislavoie commented on Oct 8, 2024

    @francislavoie
    Author

    Awesome, thanks! I'll play around with that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions