Optionalopts: RelayOptionsProtected_Protected_Internal subject that tracks the ready state of the relay
How many times the relay has tried to reconnect
Boolean authentication state (true if at least one pubkey is authenticated)
The pubkey of the most recently authenticated user, or null if not authenticated
use authenticatedPubkeys$ instead
The pubkeys that are currently authenticated on the connection, ordered oldest to most recent
The last authentication event sent to the relay
use authentications$ instead
The response to the last AUTH message sent to the relay
use authentications$ instead
All AUTH attempts on this connection keyed by pubkey (NIP-42 supports multiple authenticated users per connection)
ProtectedauthD-13/D-20: the relay's NIP-42 lines, re-derived in the constructor as Relay:auth:<url>.
The authentication challenge string from the relay
An observable that emits when underlying websocket is closed
An observable that emits when underlying websocket is closing due to unsubscribe or complete
Whether the relay is connected
Whole logical COUNT request timeout (default 10s)
Protecteddestroy$Fires when the relay is closed. Used to cancel the watchTower's keepAlive reset timer. A ReplaySubject so a reset timer armed after close() is torn down immediately.
Enable/disable ping functionality (default false)
The last connection error
How long to wait for an OK message from the relay (default 10s)
An observable that emits the icon URL for the relay, or the favicon.ico URL for the relay
An observable that emits the NIP-11 information document for the relay
ProtectedinternalLong-lived state-watcher subscriptions created in the constructor (open/close/auth)
How long to keep the connection alive after nothing is subscribed (default 30s)
An observable that emits the limitations for the relay
ProtectedlogA passive observable of all messages from the relay
An observable that emits the NIP-11 name of the relay, or its URL until the information document loads
A passive observable of NOTICE messages from the relay
ReadonlynoticeThe constructor-configured maximum number of retained notices
The retained notices from the current relay connection, ordered oldest to newest
Protected OptionalonPolicy hook for unresponsive connections
An observable that emits when underlying websocket is opened
How often to send pings in milliseconds (default 29000)
How long to wait for EOSE response in milliseconds (default 20000)
Default retry config for publish() method
How long to wait for a publish to complete (default 30s)
Whether the relay is ready for subscriptions or event publishing. setting this to false will cause all .req and .event observables to hang until the relay is ready
ProtectedreconnectThe currently armed reconnect timer subscription, if any
A method that returns an Observable that emits when the relay should reconnect
Tracks active req() operations by subscription ID
Default retry config for request() connection errors
ProtectedrouterRoutes subscription and OK replies to their listeners by id
ProtectedsocketObservable of relay status (connection, authentication, and ready state)
Default retry config for subscription() connection errors
An array of supported NIPs from the NIP-11 information document
ProtectedwatchAn internal observable that is responsible for watching all messages and updating state, subscribing to it will trigger a connection to the relay
use authenticatedPubkeys instead
use authentications instead
use authentications instead
Compose fresh raw REQ attempts while retaining lifecycle messages for high-level consumers.
Optionalopts: RelaySubscriptionOptionsOptionalgate: AuthPhaseGateAdvanced feed
Advanced search
Send an AUTH message. Can be called multiple times with events from different pubkeys to authenticate multiple users
Authenticate with bounded challenge acquisition, signing, freshness checks, and one raw AUTH verdict.
Optionalopts: RelayAuthenticateOptionsAn observable that emits whether a specific pubkey (or all of an array of pubkeys) is authenticated
ProtectedauthReturns the shared authRetry operator configured from an operation's auth options.
AuthRequiredError triggers an auth phase, and the three terminal auth errors are what it gives up with.
Optionalcounter: { consecutive: number }ProtectedauthConvert an auth requirement into an observable of whether it is satisfied
ProtectedbuildAssemble the RelayAuthContext passed to a caller's onAuthRequired handler (RAUTH-01)
Make a "cache" request to the caching server
Creates a one-shot NIP-45 COUNT request that emits a single response
ProtectedcustomInternal operator for retrying connection failures without retrying relay CLOSED errors
Optionalbase: RetryConfigProtectedcustomInternal operator for creating the repeat() operator, optionally gated by a condition
Optionalcondition: () => booleanProtectedcustomClassifier-supplied retry policy shared by the high-level publish and COUNT families.
Each caller supplies a positive allow-list; all other failures are re-thrown immediately.
The call-scoped auth counter persists across transient resubscriptions, enforcing the additive
1 + authRetries + retries EVENT-write bound.
Optionalbase: RetryConfigOptionalclassifier: (error: unknown) => booleanProtectedcustomInternal operator for creating a suspendable timeout() operator whose countdown does not advance
while gate is in an auth phase (D-15) — used by publish() so publishTimeout gets its full
budget for the real work once the auth phase closes, rather than racing authTimeout. Preserves
the same false/true/number semantics the prior bare-timeout helper had. Do NOT "simplify" this back
to a bare rxjs timeout(), which cannot pause. firstWhen is required (CR-01/WR-01) — the sole
caller states what counts as progress for its own stream shape; there is no permissive default.
Send one EVENT frame and observe its matching OK response.
Explore content with various filters
Get global most zapped content from last 4 hours
Get global trending content from last 24 hours
Feed directive
Feed directive v2
Get advanced feeds
Get default relays
Get filterlist
An async method that returns the NIP-11 information document for the relay
An async method that returns the NIP-11 limitations for the relay
Get notifications
An async method that returns the supported NIPs for the relay
Whether a specific pubkey (or all of an array of pubkeys) is authenticated on the connection
ProtectedmissingCompute the pubkeys not yet authenticated for an AuthRequirement, for RelayAuthContext.missingPubkeys.
true returns null (any authenticated user satisfies it, so no specific pubkeys are "missing").
A single pubkey returns an empty array when already authenticated, a one-element array otherwise.
An array returns only the entries isAuthenticated reports false for.
Negentropy sync event ids with the relay and an event store
Optionalopts: NegentropyOptionsGet note mentions
Publishes an event to the relay and retries when relay errors or responds with auth-required ( default 3 retries )
Optionalopts: PublishOptionsGet relays
Create a REQ observable that emits OPEN, EVENT, EOSE, and CLOSED messages.
resubscribe only repeats after the relay sends a clean CLOSED message for this REQ.
reconnect only retries connection errors and does not retry relay CLOSED errors.
Optionalopts: RelayReqOptionsMakes a single request that retries connection errors and completes on EOSE
Optionalopts: RelayRequestOptionsProtectedresetProtectedsatisfiedD-08: compute the pubkeys that currently satisfy an AuthRequirement — the join key an
operation track hangs its "now waiting for …" line off. true is satisfied by any authenticated
pubkey, so the whole current set is returned wholesale. A string or array requirement returns only
the required pubkeys that are already authenticated.
Get scored content
Search content
Send a message to the relay
ProtectedstartSet ready = false and start the reconnect timer
Creates a persistent REQ that retries connection errors (default 3 retries)
Optionalopts: RelaySubscriptionOptionsNegentropy sync events with the relay and an event store
Optionaldirection: SyncDirectionOptionalopts: RelaySyncOptionsProtectedtimelineGet trusted users
Get user profile scored content
Get user profile scored media thumbnails
ProtectedwaitWait for the relay to be ready to accept connections
StaticafterA complete condition that waits for the subscription to open
StaticcompleteAn AND complete condition, that completes when all conditions are truthy
StaticcompleteAn OR complete condition, that completes when either condition is truthy
StaticcreateStatic method to create a reconnection method for each relay
StaticdefaultA default complete condition that waits for the subscription to open and then completes after a timeout
OptionalafterOpen: numberStaticfetchFetches the NIP-11 information document for a relay
Extended relay interface for primal caching server
See
https://github.com/PrimalHQ/primal-server/blob/main/src/app_ext.jl