Configuration
The SyncedDbConfig (or SpookyConfig) object allows you to customize the behavior of the Spooky client.
Configuration Interface
TypeScript
Example Configuration
TypeScript
Options Detail
database.endpoint
The WebSocket URL for your SurrealDB instance (e.g., ws://localhost:8000/rpc). The Spooky client connects directly to the database.
database.store
'indexeddb'(default): Persistent local storage in the browser'memory': Transient in-memory storage (clears on page reload)
logLevel
Controls the verbosity of logging output:
'trace': Most verbose, includes all internal operations'debug': Detailed debugging information'info': General lifecycle events (connected, synced)'warn': Recoverable errors and warnings'error': Critical failures'fatal': Fatal errors that stop execution
persistenceClient
Determines where metadata like query states are persisted:
'surrealdb'(default): Store in the local SurrealDB instance'localstorage': Use browser localStorage- Custom implementation of
PersistenceClientinterface