fvtt-sockets

Standardize socket-based communication and GM-delegated operations in Foundry VTT modules.

1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/ImproperSubset/hh-agentics --skill fvtt-sockets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fvtt-sockets
Source: https://github.com/ImproperSubset/hh-agentics/tree/main/fvtt-dev/skills/fvtt-sockets
Command: npx skills add https://github.com/ImproperSubset/hh-agentics --skill fvtt-sockets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides proven socket-based patterns to synchronize actions and state across players in Foundry VTT modules, enabling reliable multiplayer experiences.

Core Features & Use Cases

  • Standardized namespaces (module.system) for events and messages
  • Self-invoking emission pattern to avoid duplicate handling across clients
  • GM-delegated operations via ExecuteAsGM and optional socketlib support
  • Use cases: broadcast animations, synchronized state, and cross-client gameplay events

Quick Start

Create a basic module with the namespace module.my-module, register a listener on init, and broadcast a sample event to all other clients using game.socket.emit.

Frequently Asked Questions about fvtt-sockets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I synchronize state and broadcast events across all clients in Foundry VTT?

To synchronize state in Foundry VTT, you can use standardized socket-based communication patterns like game.socket.emit to broadcast events and messages to all connected clients reliably.

How do I prevent duplicate event execution when broadcasting socket events to players?

To prevent duplicate event execution in Foundry VTT, apply a self-invoking emission pattern within your socket communication to ensure clients handle messages only once without redundant processing.

What is the best way to handle GM-delegated operations in a Foundry VTT module?

The best way to handle GM-delegated operations is using the ExecuteAsGM pattern for socket communication, which routes specific tasks to the active GM and prevents unauthorized client-side execution.

Does socketlib work with Foundry VTT sockets for advanced return values and multi-GM setups?

Yes, socketlib integrates with Foundry VTT socket patterns to support advanced return values and manage multi-GM setups, providing an alternative to native game.socket.emit for complex module workflows.

When should I register socket listeners for Foundry VTT module development?

You should register socket listeners at init-time during module setup in Foundry VTT, ensuring all event broadcasting and cross-client gameplay events are ready before players connect.

How do I structure namespaces for Foundry VTT socket events?

To structure namespaces for Foundry VTT socket events, use standardized conventions like module.system to organize event broadcasting and prevent message collisions between different modules and systems.