Creates a new FoundryClient instance
Configuration object for the client
Tests the connection to FoundryVTT server
Promise that resolves to true if connection is successful
Rolls dice using FoundryVTT's dice system
Dice formula in standard notation (e.g., '1d20+5', '3d6')
Optional
reason: stringOptional reason for the roll
Promise resolving to dice roll result
Searches for actors in FoundryVTT
Search parameters
Promise resolving to search results
Retrieves detailed information about a specific actor
The ID of the actor to retrieve
Promise resolving to actor data
Searches for items in FoundryVTT
Search parameters
Promise resolving to search results
Retrieves the current active scene or a specific scene by ID
Optional
sceneId: stringOptional scene ID. If not provided, returns current scene
Promise resolving to scene data
Retrieves a specific scene by ID
The ID of the scene to retrieve
Promise resolving to scene data
Retrieves information about the current world
Promise resolving to world information
Makes a POST request to the FoundryVTT server
The URL path to request
Optional
data: anyThe data to send in the request body
Optional
config: anyOptional axios request configuration
Promise resolving to the response
Makes a PUT request to the FoundryVTT server
The URL path to request
Optional
data: anyThe data to send in the request body
Optional
config: anyOptional axios request configuration
Promise resolving to the response
Makes a DELETE request to the FoundryVTT server
The URL path to request
Optional
config: anyOptional axios request configuration
Promise resolving to the response
Client for communicating with FoundryVTT instances
This class provides methods for interacting with FoundryVTT through both REST API and WebSocket connections. It supports dice rolling, actor/item searching, scene management, and real-time updates.
FoundryClient
Example