@xlambda-tech/redis
v0.2.0
Published
xlambda managed Redis SDK: provisioning, sub-users, backups, and a getClient() convenience.
Readme
@xlambda-tech/redis
Provision and manage xlambda-managed Redis instances.
import { RedisClient } from '@xlambda-tech/redis';
const client = new RedisClient({ apiKey: process.env.XLAMBDA_API_KEY! });
const instance = await client.instances.create({ projectId, name: 'my-cache', tier: 'starter' });
console.log(instance.connectionString); // shown once - store it now
const redis = await instance.getClient(); // configured ioredis client
await redis.set('key', 'value');ioredis is an optional peer dependency — only required if you call
getClient(). Everything else (provisioning, users, backups) has no
dependency on it.
Sub-users and backups
const readonly = await client.instances.users(instance.id).create({ permission: 'readonly' });
const backup = await client.instances.backups(instance.id).create();Not covered — use the dashboard
The Redis Browser surface (raw command execution, EVAL, MULTI, key
browsing, bulk operations, pub/sub) is deliberately not wrapped here — it's
built for the web dashboard's UI, not for calling from your own backend
code. A real application should connect with getClient() and use
ioredis directly, the same as it would against any other Redis instance.
