Storage

A simple API, very similar to the localStorage API that can be used to easily store a state in a server.

use cases : games, polls, sharing media, collaboration tools, private notes, anything that requires retrieving data after a refresh or when new participants enter the room.

setItem()

Store a value under a specific key. This storage is persistent and shared across participants of the event.

usage :

await Storage.setItem('key', 'value')
ParamType Description
keystringThe key that will allow you to retrieve the value
valuestringThe value you want to store
{ scope: string }[event/session/organization]Change the scope of the storage

@returns a promise that resolves whenever the value has been successfully stored

getItem()

Retrieve a value set at a specific key. This storage is persistent and shared across participants of the event.

usage :

await Storage.getItem('key')
ParamType Description
keystringThe key at which your item is set
{ scope: string }[event/session/organization]Change the scope of the storage

@returns a promise that resolves with the stored value