Initialize the Shogun SDK
SDK Configuration object
SDK configuration
Private
Readonly
eventEvent emitter for SDK events
Gun database instance
GunDB wrapper
Private
Readonly
pluginsPlugin registry
Optional
providerEthereum provider
RxJS integration
Storage implementation
Gun user instance
Static
Readonly
API_Current API version - used for deprecation warnings and migration guidance
Configure logging behavior for the Shogun SDK
Logging configuration object containing:
Private
createEmits an event through the core's event emitter. Plugins should use this method to emit events instead of accessing the private eventEmitter directly.
The name of the event to emit.
Optional
data: anyThe data to pass with the event.
Private
ensurePrivate
Ensure the current user has a DID associated, creating one if needed
Optional
options: DIDCreateOptionsOptional configuration for DID creation including:
The DID identifier string or null if operation fails
Retrieves data from a Gun node at the specified path
The path to the Gun node
Promise that resolves with the node data or rejects with an error
Get an authentication method plugin by type
The type of authentication method
The authentication plugin or undefined if not available This is a more modern approach to accessing authentication methods
Retrieve a registered plugin by name
Name of the plugin
The requested plugin or undefined if not found
Get all plugins of a specific category
Category of plugins to filter
Array of plugins in the specified category
Retrieve recent errors logged by the system
Number of errors to retrieve (default: 10)
List of most recent errors
Get the currently configured RPC URL
The current provider URL or null if not set
Check if a plugin is registered
Name of the plugin to check
true if the plugin is registered, false otherwise
Authenticate user with username and password
Username
User password
Promise with authentication result
Match data based on Gun's '.map()' and convert to Observable
Path to the collection
Optional
matchFn: (data: any) => booleanOptional function to filter results
Observable array of matched items
Observe a Gun node for changes
Path to observe (can be a string or a Gun chain)
Observable that emits whenever the node changes
Observe user data
Path to observe in user space
Observable that emits whenever the user data changes
Remove an event listener
The name of the event to stop listening for
The callback function to remove
Add an event listener
The name of the event to listen for
The callback function to execute when the event is emitted
Add a one-time event listener
The name of the event to listen for
The callback function to execute when the event is emitted
Get data once and return as Observable
Path to get data from
Observable that emits the data once
Stores data in Gun at the root level
The data to store
Promise that resolves when data is stored or rejects with an error
Register a new plugin with the SDK
The plugin to register
Private
registerPrivate
Register built-in plugins based on configuration
Remove all listeners for a specific event or all events
Optional
eventName: string | symbolOptional. The name of the event to remove listeners for. If not provided, all listeners for all events are removed.
Set the RPC URL used for Ethereum network connections
The RPC provider URL to use
True if the URL was successfully set
Register a new user with provided credentials
Username
Password
Optional
passwordConfirmation: stringPassword confirmation
Registration result
Unregister a plugin from the SDK
Name of the plugin to unregister
Retrieves data from the authenticated user's space at the specified path
The path to the user data
Promise that resolves with the user data or rejects with an error
Stores data in the authenticated user's space
The data to store in user space
Promise that resolves when data is stored or rejects with an error
Main ShogunCore class - implements the IShogunCore interface
This is the primary entry point for the Shogun SDK, providing access to:
Since
2.0.0