client.redis.get
Get a RedisOS key's value.
Signature
class Client {
redis: {
get(key: string): Promise<unknown>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | Redis key name |
Throws
| Error | Condition |
|---|---|
| Invalid or expired API key |
Examples
const value = await bf.redis.get('session:abc123')
console.log(value) // "user_data" or whatever was stored
Pitfalls
- Scoped to project — keys are automatically namespaced to the configured
projectId - TTL-aware — returns
for expired keys (same as a missing key)null
See also
{auto-injected}
Tested against
{auto-injected}