Type alias RecordsSubscribeRequest

RecordsSubscribeRequest: {
    from?: string;
    message: Omit<DwnMessageParams[DwnInterface.RecordsSubscribe], "signer">;
    protocol?: string;
    subscriptionHandler: RecordsSubscriptionHandler;
}

Represents a request to subscribe to records from a Decentralized Web Node (DWN).

This request type is used to specify the target DWN from which records matching the subscription criteria should be emitted. It's useful for being notified in real time when records are written, deleted or modified.

Type declaration

  • Optional from?: string

    Optional DID specifying the remote target DWN tenant to subscribe from.

  • message: Omit<DwnMessageParams[DwnInterface.RecordsSubscribe], "signer">

    The parameters for the subscription operation, detailing the criteria for the subscription filter

  • Optional protocol?: string

    Records must be scoped to a specific protocol

  • subscriptionHandler: RecordsSubscriptionHandler

    The handler to process the subscription events