set
Sets a value in the store.
Syntax
store.set(key, value, ttl);
Parameters
| Name | Type | Description |
|---|---|---|
key | string | The key of the value to set. |
value | any | The value to set. |
ttl | number | The time to live in seconds. (Default: 3600 * 24) |
Returns
Promise<void>- A promise that resolves when the value is set.
Example
// Set a value in the store that expires in 60 seconds.
await store.set('player1', 100, 60);
Available on: Client Server