The RealtimeKit Stores API allows you to create multiple key-value pair realtime stores. Users can subscribe to changes in a store and receive real-time updates. Data is stored until a session is active.
You can create a realtime store (changes are synced with other users):
| Param | Type | Description | Required |
|---|---|---|---|
name |
string | Name of the store | true |
To create a store:
You can add, update or delete entries in a store:
| Param | Type | Description | Required |
|---|---|---|---|
key |
string | Unique identifier used to store/update a value in the store | Yes |
value |
StoreValue | Value that can be stored against a key | Yes |
You can attach event listeners on a store's key, which fire when the value changes.
You can fetch the data stored in the store: