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

Custom Authentication

You can define your own custom functions to validate user input on button click. To achieve this add data-callback="{someFunction}" to the launch button. Then define your custom function in a JS file that accepts two parameters: onSuccess, onFailure.

Example

We have as an example the following HTML elements:

<input type="text" id="yomInput" placeholder="your name" autofocus>
<input type="password" id="password" placeholder="Enter password">
<button type="submit" data-callback="validatePassword" id="yomLaunch-1">start the experience</button>

In the following example function we perform simple front-end validation to match the data-callback="validatePassword"attribute defined in the yomLaunch-1 button:

function validatePassword(onSuccess, onFailure) {
    const passwordInput = document.getElementById('password');
    const enteredPassword = passwordInput.value;
    const hardcodedPassword = 'secure123';  // This is the hardcoded password

    if (enteredPassword === hardcodedPassword) {
        onSuccess();  // Call the success callback if the password is correct
    } else {
        onFailure();  // Call the failure callback if the password is incorrect
    }
}
PreviousIntegrate your StreamNextEvent Handling

Last updated 11 months ago

Was this helpful?

🏗️
🚀