Home platformOS Logo

Durable storage for key-value pairs

Last edit: Mar 05, 2020

This section describes an easy way to persist key => value pairs across requests.


Currently, there is no easy way to persist key => value pairs for an Instance for later use. An example use case for such a feature can be Salesforce integration. You authorize to Salesforce by sending a time-consuming API call to get an authorization token in return. This token is valid for 2 hours since the last use. If you wanted to be able to re-use this token instead of sending an unnecessary authorization call every time you want to send an API call to Salesforce, you would need to create a Model Schema and then write GraphQL queries and mutations to manage it. It is doable, but difficult for beginners.


The solution is to create a new tag, for example {% storage 'my_key', 'my_value' %}, which would be accessible later via{{ context.storage.my_key }}. There is potential to enhance this solution later on with, for example, being able to specify the expire key.


We are always happy to help with any questions you may have.

contact us