Overview
The Storage API provides persistent key-value storage scoped to your plugin. Permission Required:storage
Methods
set
Store a value.key- Storage key (1-255 chars, scoped to plugin)value- Value (must be JSON-serializable)ttl- Time-to-live in seconds (optional)
True if successful
get
Retrieve a value.key- Storage keydefault- Default value if key doesn’t exist
delete
Delete a value.True if successful
list_keys
List all keys (optionally filtered).prefix- Key prefix filter (optional)
Usage Examples
Basic Usage
With TTL
Using Prefixes
Session Management
Best Practices
Use Prefixes for Organization
Use Prefixes for Organization
Set TTL for Temporary Data
Set TTL for Temporary Data
Handle Missing Keys
Handle Missing Keys