WebhooksReal-timeHTTP POST

Webhooks & Real-time Notifications

Receive instant notifications when your leaderboards, scores, or competition data changes. Build responsive applications that react to events in real-time.

How Webhooks Work

1. Event Occurs

A score is updated, participant is added, or leaderboard changes in TrackScore.

2. Webhook Triggered

TrackScore immediately sends an HTTP POST request to your configured endpoint.

3. Your App Responds

Your application processes the webhook data and takes appropriate action.

Planned Webhook Events

Score & Leaderboard Events
  • score.updated - Score changes
  • leaderboard.created - New leaderboard
  • leaderboard.updated - Leaderboard changes
  • ranking.changed - Position updates
  • competition.started - Competition begins
  • competition.ended - Competition ends
Participant & Team Events
  • participant.added - New participant
  • participant.updated - Info changes
  • team.created - New team
  • team.member_added - Team member joins
  • achievement.unlocked - Milestone reached
  • milestone.reached - Goals achieved

Webhook Payload Structure

Standard Payload Format

All webhooks will follow a consistent JSON structure for easy parsing and handling.

{
  "id": "wh_1234567890abcdef",
  "type": "score.updated",
  "created": "2025-06-09T10:30:00Z",
  "data": {
    "leaderboard_id": "lb_987654321",
    "participant_id": "pt_555666777",
    "old_score": 850,
    "new_score": 950,
    "rank_change": {
      "old_rank": 5,
      "new_rank": 3
    }
  },
  "meta": {
    "webhook_url": "https://your-app.com/webhooks",
    "delivery_attempt": 1,
    "api_version": "1.0"
  }
}

Setting Up Webhooks (Planned)

Configuration Steps
1

Create Webhook Endpoint

Set up an HTTP endpoint in your application to receive webhook POST requests.

2

Configure in TrackScore

Add your endpoint URL and select which events to subscribe to in your TrackScore dashboard.

3

Test & Verify

Use our testing tools to send sample webhooks and verify your endpoint is working correctly.

4

Go Live

Enable your webhooks and start receiving real-time notifications for your leaderboards.

Security Features
  • • HMAC signature verification
  • • Timestamp validation
  • • IP address allowlisting
  • • SSL/TLS encryption required
  • • Webhook secret rotation
  • • Event filtering by permissions
Delivery Features
  • • Automatic retry with exponential backoff
  • • Delivery status tracking
  • • Failed delivery notifications
  • • Event replay capability
  • • Duplicate detection
  • • Delivery logs and analytics

Sample Webhook Handler

Node.js / Express Example
const express = require('express');
const crypto = require('crypto');
const app = express();

app.use(express.json());

// Webhook endpoint
app.post('/webhooks/trackscore', (req, res) => {
  const signature = req.headers['x-trackscore-signature'];
  const payload = JSON.stringify(req.body);
  
  // Verify webhook signature
  const expectedSignature = crypto
    .createHmac('sha256', process.env.WEBHOOK_SECRET)
    .update(payload)
    .digest('hex');
  
  if (signature !== `sha256=${expectedSignature}`) {
    return res.status(401).send('Invalid signature');
  }
  
  // Process the webhook
  const event = req.body;
  
  switch (event.type) {
    case 'score.updated':
      handleScoreUpdate(event.data);
      break;
    case 'leaderboard.created':
      handleNewLeaderboard(event.data);
      break;
    case 'participant.added':
      handleNewParticipant(event.data);
      break;
    default:
      console.log(`Unhandled event type: ${event.type}`);
  }
  
  res.status(200).send('OK');
});

function handleScoreUpdate(data) {
  console.log(`Score updated: ${data.participant_id} now has ${data.new_score} points`);
  // Your business logic here
}

app.listen(3000, () => {
  console.log('Webhook server listening on port 3000');
});

Webhook Use Cases

Real-time Dashboards

Update live dashboards and displays instantly when scores change.

  • • Live streaming overlays
  • • Event displays and kiosks
  • • Mobile app push notifications
  • • Real-time analytics updates
Automated Workflows

Trigger automated actions based on competition events.

  • • Send congratulations emails
  • • Update external databases
  • • Generate certificates
  • • Social media announcements
Integration Sync

Keep external systems synchronized with your TrackScore data.

  • • CRM system updates
  • • Learning management systems
  • • Business intelligence tools
  • • Customer support platforms
Notification Systems

Build comprehensive notification systems for participants and organizers.

  • • Slack/Teams notifications
  • • SMS alerts for milestones
  • • Discord bot integrations
  • • Custom notification channels

Webhook Best Practices

✓ Best Practices
  • • Always verify webhook signatures
  • • Respond with 200 status for successful processing
  • • Process webhooks idempotently
  • • Handle webhook processing asynchronously
  • • Log webhook events for debugging
  • • Implement proper error handling
  • • Use HTTPS endpoints only
✗ Common Pitfalls
  • • Blocking webhook processing with long operations
  • • Not handling duplicate webhook deliveries
  • • Exposing webhook endpoints without authentication
  • • Returning non-200 status codes for successful processing
  • • Not implementing proper retry logic
  • • Ignoring webhook signature verification
  • • Storing sensitive data in webhook URLs

Get Early Access to Webhooks

Want to be among the first to use TrackScore webhooks? Join our early access program to get beta access and help shape the final implementation.