@nats-io/jetstream
    Preparing search index...

    Type Alias JetStreamClient

    A type for interacting data stored in JetStream

    type JetStreamClient = {
        apiPrefix: string;
        consumers: Consumers;
        streams: Streams;
        getOptions(): JetStreamOptions;
        jetstreamManager(checkAPI?: boolean): Promise<JetStreamManager>;
        publish(
            subj: string,
            payload?: Payload,
            options?: Partial<JetStreamPublishOptions>,
        ): Promise<PubAck>;
    }
    Index

    Properties

    apiPrefix: string

    Returns the JS API prefix as processed from the JetStream Options

    consumers: Consumers

    Returns an object for accessing Consumers. Consumers allow you to process messages stored in a stream. To create a consumer use JetStreamManager.

    streams: Streams

    Returns an object for accessing Streams.

    Methods

    • Returns a JetStreamManager that uses the same JetStreamOptions as the current JetStream context

      Parameters

      • OptionalcheckAPI: boolean

      Returns Promise<JetStreamManager>

    • Publishes a message to a stream. If not stream is configured to store the message, the request will fail with RequestError error with a nested NoRespondersError.

      Parameters

      • subj: string

        the subject for the message

      • Optionalpayload: Payload

        the message's data

      • Optionaloptions: Partial<JetStreamPublishOptions>

        the optional message

      Returns Promise<PubAck>