LogoLogo
  • Manifesto
    • What is YOM?
      • State of Gaming
      • Decentralizing Cloud Gaming
    • Technology
      • YOM DePIN
      • YOM Webapp
      • YOM SDK
    • 🏆Ecosystem
      • Value Flow
      • Tokenomics
      • Reputation
      • Governance
      • Programs
  • 🏗️BUILD
    • 📄Overview
      • Key Components
    • 🚀Getting Started
      • Import the UE5 SDK
      • Configure your Stream
      • Test your Stream
      • Package your Stream
      • Deploy your Stream
      • Integrate your Stream
        • Custom Authentication
        • Event Handling
        • Multi-Stream Setup
        • Dynamic Layouts
    • 🛠️SDK Features
      • Responsive Design
      • Custom Characters
      • Registering Events
      • Push Events
      • Optional
        • SDK Assets
        • Inventory
        • Portals
        • Nameplates
        • Gated Access
        • Airdrops
        • Counters
        • Control Hints
    • ⚡Stream Optimization
  • 💎EARN
    • 💻Node Rewards
    • ⚖️YOM vs Aethir
    • ⚡Node Operators Manual
      • Understanding Your Role as a Node Operator
      • Self-Hosted vs. Delegated Nodes
        • Delegation
        • Self-Hosted
          • Disk
          • Code
      • Hardware Requirements & Rig Optimization
      • Getting Started: Choosing Your Node Type & Obtaining a Node License
      • Installation Guide
      • Monitoring Your Node
      • The $YOM Reward System
      • The Role of $YRX (XP Points)
      • Staking $YOM for Enhanced Rewards
      • Troubleshooting Common Issues & FAQs
      • Community & Support Channels
      • Understanding Network Dynamics & Updates
      • Security Best Practices
      • $YOM Token Economy & Burn Mechanism
      • KYC & Compliance
      • Minimum Payout Program & Stay Online Incentives
      • Potential Risks & Considerations
      • Glossary of Terms
  • Node Owners
  • Compliancy
    • Token Disclaimer
    • Terms and Conditions
    • Privacy Policy
  • About
    • Token Allocation
    • 🙋Social Media
    • ⁉️FAQ
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. BUILD
  2. Getting Started
  3. Integrate your Stream

Event Handling

With YOM you can build custom web widgets that communicate directly with the stream via the postToYOM function:

postToYOM('AdjustSetting', {settingValue: 'newValue'});

This function facilitates sending commands or adjustments to the stream. Do ensure you register events inside of your game project, to bind the events to certain functions.

Example

We assume you have 3 buttons on your webpage (#spawnBot, #removeBot, #clearBot). On click we can trigger content within the stream using the postToYOM function:

document.addEventListener('DOMContentLoaded', function() {
    document.getElementById('spawnBot').addEventListener('click', function() {
        postToYOM('SpawnBot', {amount: '1'});
    });

    document.getElementById('removeBot').addEventListener('click', function() {
        postToYOM('RemoveBot', {amount: '1'});
    });

    document.getElementById('clearBot').addEventListener('click', function() {
        postToYOM('ClearBot', {});
    });
});

Listen for Events

Using YOM SDK you can push events from the game to the web browser. From there you can connect your own logic to it.

YOM SDK can automatically push events to the data layer for GTM and GA integration. Configure your GTM to capture these events for detailed interaction tracking.

PreviousCustom AuthenticationNextMulti-Stream Setup

Last updated 11 months ago

Was this helpful?

🏗️
🚀