### Initialize CatboxRedis Client Standalone Source: https://github.com/hapijs/catbox-redis/blob/master/API.md Demonstrates initializing a CatboxRedis client instance for standalone use with specified connection and cache options. ```js const Catbox = require('@hapi/catbox'); const { Engine: CatboxRedis } = require('@hapi/catbox-redis'); const cache = new Catbox.Client(CatboxRedis, { partition : 'my_cached_data', host: 'redis-cluster.domain.com', port: 6379, db: 0, tls: {}, }); ``` -------------------------------- ### Initialize CatboxRedis within Hapi Server Source: https://github.com/hapijs/catbox-redis/blob/master/API.md Shows how to configure the Catbox Redis engine as a cache provider within a Hapi server instance. ```js const Hapi = require('hapi'); const { Engine: CatboxRedis } = require('@hapi/catbox-redis'); const server = new Hapi.Server({ cache : [ { name: 'my_cache', provider: { constructor: CatboxRedis, options: { partition : 'my_cached_data', host: 'redis-cluster.domain.com', port: 6379, db: 0, tls: {}, } } } ] }); ``` -------------------------------- ### CatboxRedis Engine Constructor and Options Source: https://github.com/hapijs/catbox-redis/blob/master/API.md Details the constructor for the Catbox Redis engine and its various configuration options for connecting to Redis and setting cache behavior. ```APIDOC CatboxRedis.Engine(options) - Initializes a new Catbox Redis engine instance. - Parameters: - options: Object - Configuration options for the engine. - Connection Options (specify one): - client: Object - A custom, manually managed Redis client instance compatible with ioredis API, exposing a 'status' property set to 'ready' when connected. - url: string - A Redis server URL. - socket: string - A path to a unix domain socket. - cluster: Array<{host: string, port: number}> - An array of Redis cluster node addresses. - Fallback Connection Options (used if no other method specified): - host: string - The Redis server hostname. Defaults to '127.0.0.1'. - port: number | string - The Redis server port or unix domain socket path. Defaults to 6379. - Catbox Options: - partition: string - A prefix for all item keys. Defaults to ''. - Other Supported Redis Options: - password: string - The Redis authentication password. - db: number | string - The Redis database number or name. - sentinels: Array<{host: string, port: number}> - Sentinel addresses for high availability. - sentinelName: string - The name of the sentinel master. - tls: Object - TLS configuration options for ioredis. - Other redis options not mentioned above are also supported. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.