Constructs a new DataBaseHolster instance connected to a Holster instance.
The main Holster instance.
Optionalcore: anyOptionalsea: anyOptional cryptography (Holster SEA) instance; will be auto-discovered if not provided.
Private_isWhether the database instance has been destroyed
Private Optional_rxjsRxJS-based Holster observable/stream helper
PrivateauthPolling interval for auth state changes
Private Optional ReadonlycoreShogunCore instance for emitting events
Crypto utilities used internally
Private ReadonlyeventEventEmitter for app-specific event management
Holster instance
PrivatelastLast known user state
Private ReadonlyonRegistered callbacks for auth state changes
Holster SEA cryptography context
Cached user instance or null if not logged in
Private ReadonlyusernamesHolster node dedicated to mapping usernames to pubkeys
Get the Holster instance (for backward compatibility with gun property). Returns a proxy that provides Gun-like API on top of Holster.
Aggressively clean up authentication state and session.
PrivatebuildAssemble a standard AuthResult object after a successful login.
PrivatecreatePrivatecreateCreate a proxy that makes Holster look like Gun for compatibility.
PrivatecreateInternalHelper to create a user with pair and register alias.
Tears down the DataBaseHolster instance and performs cleanup.
Emit a custom event.
Optionaldata: anyPrivateensureEnsures that an alias/username is available in Holster for registration.
Returns the currently authenticated user's public key and Holster user instance.
Get current user's public key.
Initialize the database instance.
PrivateisChecks if a given alias/username is available on Holster. Uses the same approach as isAliasTaken but returns the inverse.
PrivateisChecks if a given alias/username is taken on Holster.
Check if a user is currently logged in (there is a valid session).
true if logged in; otherwise false.
Sign in (authenticate) as an existing user by username/password or SEA pair.
Optionalpair: null | ISEAPairAuthenticate using a SEA pair directly. If username doesn't exist, creates a new user with the provided pair.
Legacy API: Sign in using a username and SEA pair.
Log out the current user, clear local state and remove session from storage.
PrivatenotifyInternalInternal: notify all onAuth callbacks with current user.
User's public key (pub).
Remove an event handler.
Register an event handler.
Listen for authentication/sign-in events (login, logout, etc).
Function to call with new user instance.
Function to remove the registered callback.
Register an event handler for a single event occurrence.
PrivateregisterRegister a new alias (username) → public key mapping on Holster.
PrivateresetInternalReset holster.user() authentication state and clear cached user.
Attempt to restore a previously saved session from sessionStorage.
Object indicating success, error, and userPub if restored.
Returns the bound RxJS Holster helper (reactive streams).
PrivatesaveSave credentials for the current session to sessionStorage, if available.
Register and authenticate a new user account.
Optionalpair: null | ISEAPairPrivatesubscribeInternalInternal: subscribe to Holster auth state changes and notify listeners. Since Holster doesn't have native auth events, we poll for changes.
PrivatevalidateValidate that a provided password meets minimum length requirements.
PrivatevalidateValidate a signup request's username, password, and/or cryptographic pair.
Optionalpair: null | ISEAPair
DataBaseHolster
Manages Holster user authentication and various utility helpers for session, alias/username, SEA cryptography, event handling, and reactive streams. This is a native Holster implementation that doesn't require Gun compatibility layer.