- Keys must be at least 1 character long.
- Keys cannot contain
:(colon) or#(hash) characters. - Data stored must be JSON-serializable.
PersistentStore
Method reference
get
string
required
The key to retrieve the value for. Must be at least 1 character long and cannot contain
: or # characters.undefined if not found.
Throws
ZodError— Thrown if the key is invalid (empty or contains forbidden characters).
set
string
required
The key to set the value for. Must be at least 1 character long and cannot contain
: or # characters.any
required
The value to store. Can be any JSON-serializable type (object, array, string, number, boolean, null).
ZodError— Thrown if the key is invalid (empty or contains forbidden characters).
Related
- KV cache recipe — Examples and patterns for using key-value stores.
- attemptStore — Store data scoped to the current attempt.