Our WebSockets feed is currently in Beta and subject to changes. We do our best to make backwards compatible changes. If you have questions or feedback, please come chat with us in our Discord.
Overview
WebSockets give creators a direct feed of the support payments that are left on their pages. Once a Support Payment is processed, a simple payload is pushed to your WebSocket connection so you can handle it in real-time.Setup
1. Get an API key
You can get an API key under API Keys on your dashboard.
API keys are private and should never be made public.
2. Connect to a feed
You can use websocketking.com to test WebSocket connections.
Firehose
The firehose feed sends all support payments for all pages you own.Firehose Feed
Page Activity Feed
The activity feed sends all support payments for a specific page you own or have access to.Page Activity Feed
3. Keep your connection alive
With WebSockets, events are only sent/received when a connection is open. We only send events once to all open WebSocket connections after the payment is received. To ensure you receive the events, there are several ways to make sure your connection stays alive:- Implement retry and reconnect mechanisms in your client.
-
Send a simple
ping
message every 60 seconds to keep the connection alive. The server should respond withpong
.
Events
The event payload may contain additional/undocumented fields but will always contain the documented fields.
campaigntip.notify
Sent when a new support payment is received for a page you own or when a support payment is replayed from the activity feed.Testing
You can test receiving events by sending an echo message to an open WebSocket connection. The server will respond by sending the payload of the message back. Below is an example of an echo message that can be sent to test receiving acampaigntip.notify
event.
This example is formatted but should be sent as a string. It can be pasted in websocketking.com but would be surrounded in quotes in code.