WebApps 2
Storage
To acces a Data Storage defined in the manifest of a WebApp import storage
in a server side context.
// retrieve an instance of the storage API
import storage from "@sitevision/api/server/storage";
// try to retrieve specific stores
const collectionDataStore = storage.getCollectionDataStore('myCollectionStore');
const keyValueStore = storage.getKeyValueDataStore('myStore');
// manifest.json
{
...
"storage": {
"collectionDataStore": "myCollectionStore",
"keyValueDataStore": "myStore" // multiple stores ["x", "y"]
}
}