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

    Type Alias KvOptions

    KvOptions: KvLimits & {
        allow_direct: boolean;
        bindOnly: boolean;
        codec: KvCodecs;
        metadata?: Record<string, string>;
        streamName: string;
        timeout: number;
    }

    Type Declaration

    • allow_direct: boolean

      If true and on a recent server, changes the way the KV retrieves values. This option is significantly faster, but has the possibility of inconsistency during a read.

    • bindOnly: boolean

      Doesn't attempt to create the KV stream if it doesn't exist.

    • codec: KvCodecs

      An encoder/decoder for keys and values

    • Optionalmetadata?: Record<string, string>

      Metadata field to store additional information about the kv. Note that keys starting with _nats are reserved. This feature only supported on servers 2.10.x and better.

    • streamName: string

      The underlying stream name for the KV

    • timeout: number

      How long to wait in milliseconds for a response from the KV. If not set, the KV uses the timeout of the JetStream client it was created with. A timeout on a put or update overrides it. When set, the KV's requests go through a new JetStream client with the same options, not the one the Kvm was created with.