Skip to main content

Privacy Policy Component

The Privacy Policy component provides a clean interface for displaying privacy policy information, terms of service, and other legal documents to users in your Hyperfy world. Think of it as a legal information display system that can show important policy information when needed.

Important: This component creates a privacy policy display interface that appears when triggered. It's designed to show legal information, terms of service, and privacy policies to users in a clean, accessible format.

Download Component

What Does It Do?

The Privacy Policy component is like having a legal information system for your 3D world. You can:

  • Display privacy policy information to users when needed
  • Show terms of service and legal documents
  • Provide legal compliance for your Hyperfy world
  • Create accessible legal information for all players
  • Sync policy displays across all players in multiplayer environments
  • Trigger policy displays through events from other components
  • Maintain legal compliance with privacy regulations

Important: This component creates a floating privacy policy interface that appears when activated. It displays legal information in a clean, readable format and can be triggered by events from other components.

Video Demo

Watch the Privacy Policy component in action: legal information display, terms of service, privacy policies, and synchronized effects across all players.

Properties

Basic Settings

PropertyTypeDefaultDescription
App IDtextAutoUnique name for this component (auto-generated)
Node Nametext""Required: Name of the 3D object in your scene
Debug LogstogglefalseShow detailed information for troubleshooting
Add CollisiontoggletrueMake the object solid (players can't walk through)
Start VisibletoggletrueShould the object be visible when the scene loads?

Privacy Policy Settings

PropertyTypeDefaultDescription
Policy Contenttextarea""Required: The privacy policy content to display
Policy Titletext"Privacy Policy"Title displayed in the policy interface
Show Policy ButtontoggletrueShow a button to display the policy
Auto Show PolicytogglefalseAutomatically show policy when component loads

Display Settings

PropertyTypeDefaultDescription
Policy Widthnumber600Width of the policy display in pixels
Policy Heightnumber400Height of the policy display in pixels
Background Colorcolor#00000080Background color with transparency
Text Colorcolor#FFFFFFColor of the policy text
Font Sizenumber14Size of the policy text in pixels

How Events Work

The Privacy Policy component listens for events to control policy display visibility and can be triggered by other components. It uses its unique App ID (generated by Hyperfy) to identify itself in the event system.

Action Types

ActionDescriptionParameters
show-policyShow the privacy policy interfaceNone
hide-policyHide the privacy policy interfaceNone
toggle-policyToggle the privacy policy visibilityNone

Event Format

In the Event Listeners field, you can specify events like this:

[
{
"id": "a1b2c3d4e",
"actions": [
{
"type": "show-policy",
"params": {}
}
]
}
]

Note: When referencing this component in events from other components, use the App ID that Hyperfy generated for this component. Also, when duplicating components, be sure you make the app unique, so it has a new AppID.

Common Use Cases

  • Object: A legal compliance button
  • Event: Player needs to see privacy policy
  • Action: Privacy policy interface appears

2. Terms of Service

  • Object: A terms of service display
  • Event: Player enters the world
  • Action: Terms of service are shown

3. Data Protection Information

  • Object: A data protection notice
  • Event: Player interacts with data collection
  • Action: Data protection information is displayed
  • Object: A legal information center
  • Event: Player needs legal information
  • Action: Legal documents are shown

5. Compliance Requirements

  • Object: A compliance requirement display
  • Event: Player needs to understand requirements
  • Action: Compliance information is shown

Step-by-Step Setup

1. Add the Component

  • Drag the Privacy Policy component into your scene
  • Select the 3D object you want to associate with policy display

2. Configure Basic Settings

  • Set the Node Name to match your 3D object's name
  • Choose if the object should Start Visible
  • Decide if it should Add Collision (be solid)

3. Set Up Policy Content

  • Enter your Policy Content (the legal text to display)
  • Set a Policy Title for the policy interface
  • Configure display settings (width, height, colors)

4. Configure Display Behavior

  • Enable Show Policy Button if you want a button to display the policy
  • Enable Auto Show Policy if you want the policy to show automatically
  • Configure any additional display settings

5. Configure Events

  • In Event Listeners, add the events that should trigger policy display
  • Use the JSON format shown above
  • Replace event names with actual events from other components

6. Test Your Setup

  • Enable Debug Logs to see what's happening
  • Test policy display and visibility control
  • Check that all players see the same policy interface

Tips for Designers

Writing Good Policy Content

  • Keep policy content clear and understandable
  • Use appropriate legal language
  • Ensure content is up-to-date and compliant
  • Test content length to ensure it fits the display

Planning Your Policy System

  • Think about when players should see policy information
  • Consider timing and delays for user experience
  • Plan for both single-player and multiplayer scenarios
  • Design clear visual cues for policy access

Testing Your Setup

  • Always test with multiple players
  • Use debug logs to troubleshoot issues
  • Test edge cases (what happens if players disconnect?)
  • Verify policy content displays correctly

Performance Considerations

  • Policy displays are lightweight - minimal performance impact
  • Consider the impact on player experience
  • Test with different screen sizes and devices

Troubleshooting

Policy Not Showing

  • Check that the event is being sent correctly
  • Verify that the Event Listeners format is correct
  • Enable Debug Logs to see what's happening
  • Test with Auto Show Policy enabled

Content Display Issues

  • Check that policy content is not too long for the display
  • Verify that text formatting is appropriate
  • Ensure special characters are properly handled
  • Test with different font sizes

Events Not Triggering

  • Check that the event id matches exactly
  • Verify the Event Listeners JSON format is correct
  • Test with simple events first
  • Use debug logs to see event reception

Display Layout Issues

  • Adjust Policy Width and Policy Height for your content
  • Check that the display fits properly on different screen sizes
  • Verify that colors provide good contrast
  • Test with different content lengths

Best Practices

  • Start Simple: Test with basic policy display before adding complexity
  • Use Clear Content: Ensure policy content is understandable
  • Plan for Compliance: Consider legal requirements for your region
  • Test Display: Verify that policy content displays correctly
  • Use Appropriate Timing: Show policies when relevant to user actions
  • Configure Events: Use specific event listeners for better control
  • Test Thoroughly: Always test with multiple players and scenarios
  • Document Content: Keep policy content documented and up-to-date
  • Consider Accessibility: Ensure policy display is accessible to all players
  • Maintain Compliance: Regularly review and update policy content
  • Compliance: Ensure policy content meets legal requirements
  • Updates: Regularly review and update policy content
  • Accessibility: Make policy information accessible to all users
  • Documentation: Keep policy content documented for legal purposes
  • Review: Have legal professionals review policy content

Integration Examples

Basic Policy Display

// Show privacy policy
world.emit('privacy-policy123', {
action: 'show-policy'
});

// Hide privacy policy
world.emit('privacy-policy123', {
action: 'hide-policy'
});

Event Integration

[
{
"id": "legal-button123",
"actions": [
{
"type": "show-policy",
"params": {}
}
]
}
]

Auto-Display Configuration

// Configure auto-display
{
"autoShowPolicy": true,
"policyContent": "Your privacy policy content here...",
"policyTitle": "Privacy Policy"
}