DocsSocial EventsOverview

Social Events

Trigger contextual content in the Shard Launcher when players achieve milestones in your game.


How It Works

  1. You define events - Boss defeats, achievements, secret discoveries, etc.
  2. Your game triggers events - Call the trigger function when milestones happen
  3. Shard Launcher receives - Displays contextual content for the achievement
  4. Players see relevant content - Tips, guides, community clips appear in their feed
┌─────────────┐       HTTP POST       ┌─────────────────┐
│   Your      │──────────────────────►│   Shard         │
│   Game      │  /api/social/trigger  │   Launcher      │
└─────────────┘                       └─────────────────┘


                                      ┌─────────────────┐
                                      │   Contextual    │
                                      │   Feed Updated  │
                                      └─────────────────┘

Quick Start

1. Create Event IDs with ShardKit CLI

# Initialize your project
npx @shard-dev/shardkit init
# Select your engine and enable Social
 
# Add social events
npx @shard-dev/shardkit social add
# Enter "Boss Defeated" → myGame_e5f6g7h8
 
# Export for distribution
npx @shard-dev/shardkit social export

2. Trigger Events in Your Game

# Godot 4.x
func _on_boss_defeated():
    ShardSDK.social.trigger_event("myGame_boss_defeated")
 
func _on_secret_found():
    ShardSDK.social.trigger_event("myGame_secret_found")

Event IDs

Each social event is identified by an event ID - a unique string that maps to contextual content:

npx @shard-dev/shardkit social add
# Enter "Boss Defeated" → myGame_e5f6g7h8

Event IDs follow the format: {camelCaseGameName}_{8hexChars}

Use descriptive event IDs that clearly indicate the achievement type.


Benefits

For Players

  • Relevant content - See guides and tips exactly when needed
  • Community connection - Discover how others tackled the same challenge
  • Achievement celebration - Share milestones with the community

For Developers

  • Simple integration - One function call per event
  • No backend required - Launcher handles all content delivery
  • Analytics ready - Track which events players trigger most

Configuration

All SDKs support the same configuration options:

SettingDefaultDescription
launcher_urlhttp://localhost:9876Shard Launcher URL
enable_socialtrueEnable/disable social events

Configure in Project Settings under shard_sdk/:

# Or programmatically
ShardSDK.launcher_url = "http://localhost:9876"
ShardSDK.enable_social = true

Error Handling

All SDKs use fire-and-forget HTTP requests with silent failure:

  • If the Shard Launcher is not running, calls silently fail
  • No exceptions are thrown to your game code
  • Network timeouts are handled automatically (5 second timeout)

Your game continues running normally even if the launcher is unavailable.


Engine-Specific Setup


Next Steps