Options
All
  • Public
  • Public/Protected
  • All
Menu

LaunchDarkly Server-Side Node SDK Redis Integration (2.1.0)

Index

Functions

  • RedisBigSegmentStore(options?: LDRedisOptions): (config: LDOptions) => BigSegmentStore
  • Configures a big segment store backed by a Redis instance.

    "Big segments" are a specific type of user segments. For more information, read the LaunchDarkly documentation about user segments: https://docs.launchdarkly.com/home/users/segments

    Parameters

    • Optional options: LDRedisOptions

      The standard options supported for all LaunchDarkly Redis features, including both options for Redis itself and others related to the SDK's behavior.

    Returns (config: LDOptions) => BigSegmentStore

      • (config: LDOptions): BigSegmentStore
      • Configures a big segment store backed by a Redis instance.

        "Big segments" are a specific type of user segments. For more information, read the LaunchDarkly documentation about user segments: https://docs.launchdarkly.com/home/users/segments

        Parameters

        • config: LDOptions

        Returns BigSegmentStore

  • RedisFeatureStore(redisOpts?: ClientOpts | LDRedisOptions, cacheTTL?: number, prefix?: string, logger?: object | LDLogger, client?: RedisClient): (config: LDOptions) => LDFeatureStore
  • Configures a feature store backed by a Redis instance.

    For more details about how and why you can use a persistent feature store, see the Using Redis as a persistent feature store.

    For backward compatibility, this function supports both an older syntax that uses multiple parameters and a newer one that uses an LDRedisOptions object. The newer style is preferred, for clarity:

    const store = RedisFeatureStore(
    {
    redisOpts: { host: 'redishost', port: 6379 },
    prefix: 'app1',
    cacheTTL: 30
    });

    The equivalent in the older syntax (which will be dropped in a future version) would be:

    const store = RedisFeatureStore(
    { host: 'redishost', port: 6379 },
    30,
    'app1'
    );

    Parameters

    • Optional redisOpts: ClientOpts | LDRedisOptions

      Optional configuration parameters to be passed to the redis package.

    • Optional cacheTTL: number

      The amount of time, in seconds, that recently read or updated items should remain in an in-memory cache. If it is zero, there will be no in-memory caching.

    • Optional prefix: string

      A string that should be prepended to all Redis keys used by the feature store.

    • Optional logger: object | LDLogger

      A custom logger for warnings and errors. If not specified, it will use whatever the SDK's logging configuration is.

    • Optional client: RedisClient

      Pass this parameter if you already have a Redis client instance that you wish to reuse. In this case, redisOpts will be ignored.

    Returns (config: LDOptions) => LDFeatureStore

    A factory function that the SDK will use to create the data store. Put this value into the featureStore property of [[LDOptions]].

      • (config: LDOptions): LDFeatureStore
      • Configures a feature store backed by a Redis instance.

        For more details about how and why you can use a persistent feature store, see the Using Redis as a persistent feature store.

        For backward compatibility, this function supports both an older syntax that uses multiple parameters and a newer one that uses an LDRedisOptions object. The newer style is preferred, for clarity:

        const store = RedisFeatureStore(
        {
        redisOpts: { host: 'redishost', port: 6379 },
        prefix: 'app1',
        cacheTTL: 30
        });

        The equivalent in the older syntax (which will be dropped in a future version) would be:

        const store = RedisFeatureStore(
        { host: 'redishost', port: 6379 },
        30,
        'app1'
        );

        Parameters

        • config: LDOptions

        Returns LDFeatureStore

        A factory function that the SDK will use to create the data store. Put this value into the featureStore property of [[LDOptions]].

Generated using TypeDoc