Skip to content

Instantly share code, notes, and snippets.

@rmdwirizki
Last active June 10, 2024 10:05
Show Gist options
  • Save rmdwirizki/1d4cd9c8daadf74d2cdf72af2b97d8e5 to your computer and use it in GitHub Desktop.
Save rmdwirizki/1d4cd9c8daadf74d2cdf72af2b97d8e5 to your computer and use it in GitHub Desktop.
Trakteer Webhook: Websocket Javascript Example
<script src="https://assets.trakteer.id/js/trws.min.js"></script>
<script>
// Get your channel ID in https://trakteer.id/manage/webhook/websocket
const channelID = 'INPUT_YOUR_CHANNEL_ID_HERE';
// Register Creator Channel ID
TrakteerWS.register(channelID);
// Function to handle on stream test notification event
TrakteerWS.onStreamTest = (data) => {
// WRITE YOUR HANDLER CODE HERE
};
// Function to handle on new traktiran notification event
TrakteerWS.onNewTipSuccess = (data) => {
// WRITE YOUR HANDLER CODE HERE
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment