Dev Guide
Dev GuideUser GuideGitHubNuGetDevCommunityDoc feedbackLog In

Shared key value store

This topic describes how to store and share common data between different components of your application using the shared key value store in Optimizely Connect Platform (OCP).

The application SDK provides a shared Key-Value Store instance available to all your application components. This store exposes the same KVStore interface as our regular Key Value Store and is intended as a way to share common data between different components of your application when the account isolation provided by the regular KV store is not necessary or is limiting. A common problem this store intends to solve is the persistence of mapping data between third-party systems and ODP accounts (for example, source system account identifiers to OCP app install ids. It is really only required when a global function is included as part of the application but its usage is not limited to this setup. Read more about Global Functions.

code example:
import {storage} from '@zaius/app-sdk';
await storage.sharedKvStore.put(sourceSystemId, zaiusInstallId);

🚧

Important

As a shared resource, care should be taken with key namespacing to avoid key clobbering. Like the regular KV Store, do not write sensitive data such as API keys, API tokens, or usernames and passwords to the key-value store. While the data is encrypted at rest, it does not have the same level of security as the secret or setting stores and is not suitable for storing sensitive information.