Initialize the Shogun SDK
SDK Configuration object
Private
_gunPrivate
_userPrivate
Optional
currentPrivate
Readonly
eventPrivate
Readonly
pluginsOptional
providerStatic
Readonly
API_Access to the Gun instance
The Gun instance
Access to the current user
The current Gun user instance
Configure logging behavior for the Shogun SDK
Logging configuration object containing:
Emits 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.
Indicates if the event had listeners.
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
Get the current authentication method
The current authentication method or undefined if not set
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
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
Remove an event listener
The name of the event to stop listening for
The callback function to remove
Returns this instance for method chaining
Add an event listener
The name of the event to listen for
The callback function to execute when the event is emitted
Returns this instance for method chaining
Add a one-time event listener
The name of the event to listen for
The callback function to execute when the event is emitted
Returns this instance for method chaining
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.
Returns this instance for method chaining
Set the current authentication method This is used by plugins to indicate which authentication method was used
The authentication method used
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
Main ShogunCore class - implements the IShogunCore interface
This is the primary entry point for the Shogun SDK, providing access to:
Since
2.0.0