Skip to main content

Base App Component

The Base App component is designed as a foundational template for creating new Hyperfy applications. It provides essential infrastructure including node management, collision setup, visibility control, debug logging, and configuration management. This component serves as the starting point for developing custom interactive applications by providing common functionality that most apps require. Important: This component is a template/boilerplate - it provides the basic structure and utilities but requires custom logic to be added for specific functionality.

Download Component

Overview

The BaseApp component provides a standardized foundation for building Hyperfy applications. It includes common utilities for node management, collision detection, visibility control, and debug logging. The component acts as a boilerplate template - it sets up the basic infrastructure that most applications need, allowing developers to focus on implementing their specific business logic rather than common setup tasks.

Key Features

  • Node Management: Automatic node discovery and validation in the 3D scene
  • Collision Setup: Automatic collision detection and rigidbody creation for 3D models
  • Visibility Control: Basic visibility state management for 3D objects
  • Debug System: Comprehensive logging system for troubleshooting and development
  • Configuration Management: Standardized configuration system with hints and validation
  • Error Handling: Robust error handling with detailed logging
  • Extensible Architecture: Easy to extend with custom logic and additional features

Properties

Basic Configuration

PropertyTypeDefaultDescription
appIDstring""Unique identifier for this application
nodeNamestring""The name of the 3D node in your scene to control
isDebugModebooleanfalseEnable detailed logging for troubleshooting
hasCollisionbooleantrueForces all meshes to have collision
isVisiblebooleantrueInitial visibility state when the app starts

Base Settings

PropertyTypeDefaultDescription
baseSectionsection-Base configuration section

Events

Debug Events

Event NameDescriptionParameters
logDebug logging event{ kind, timestamp, nodeName, message }

Event Parameters

The debug log event includes these parameters:

ParameterTypeDescription
kindstringLog level (info, warn, error, debug)
timestampnumberUnix timestamp when the log was created
nodeNamestringName of the controlled 3D node
messagestringLog message content

Integration

The Base App component works by providing a foundation that other components and custom logic can build upon. It handles the common setup tasks like node discovery, collision setup, and debug logging, allowing developers to focus on implementing their specific functionality. The component can be extended by adding custom methods to the BaseApp class and implementing logic in the _initClass() method.

Best Practices

  • Use this component as a starting point for all new Hyperfy applications
  • Enable debug mode during development to troubleshoot issues
  • Extend the BaseApp class with custom methods for your specific functionality
  • Implement your main logic in the _initClass() method
  • Use the provided debug logging system for consistent error tracking
  • Configure collision settings appropriately for your 3D models
  • Set appropriate node names that match your scene structure