New global storage SDK methods

We recently released 3 new monday.storage SDK methods that allow you to maintain storage across each application, rather than each instance. With the new methods, the storage is not tied to a specific instance so it does not reset between major versions.

  • monday.storage.getItem(key)
  • monday.storage.setItem(key, value)
  • monday.storage.deleteItem(key)

Please note that with global-level storage, developers are the ones responsible for managing how items are stored on the client side - not monday.

1 Like

Hi @rachelatmonday

With the new methods, the storage is not tied to a specific instance so it does not reset between major versions.

Is this reset a new behavior? I don’t remember reading this on the SDK storage documentation before this update. So if we update a scope in our app (which lead to a major version) users will lost their app data stored in the instance storage? Seem a weird behavior to me.

Hi @rachelatmonday,

Thank you, this improvement is a step forward for making the storage API usable in more cases. Now we can access the same data from two App features.

Could this global storage be available on the Server side? Now that this storage is not specific to an App feature, we could fetch this data from our external back-end.

This would allow marketplace apps to write automation that modifies the storage of their App, otherwise we need to either use monday board columns or our own storage outside of monday.

Thank you!
Max

Hi @clement.devdevils,

This is not a new behavior, but we did update the documentation based on a request! The storage resets because moving between app versions creates separate versions of each app feature that have their own app storage.

1 Like

Hi @MaxTheBean,

It is also available on the server-side and is exposed by this SDK!

Hi @rachelatmonday,

Thank you this is good to hear!

I saw a link to this Apps CLI which would be useful to setup a CI/CD pipeline. Is this ready to be used by developers? I tried it but I am receiving 403 (forbidden) errors (I did configure my API token).

Thanks!
Max

Hi again @MaxTheBean,

The Apps CLI and related SDK are part of an upcoming release, so they are not ready for dev usage. We will add a note to the Readme file to avoid any confusion!

We will update you all in the community and changelog, so keep your eyes out over the next quarter for the release :eyes:

2 Likes

Hi @rachelatmonday

Having an issue with the monday.storage.deleteItem(key) method on the monday-sdk-js 0.4.8.

Here is a basic reproduction case:

const monday = mondaySdk();
await monday.storage.setItem('key-test', 'Hello').then((data) => console.log('Set', data));
await monday.storage.getItem('key-test').then((data) => console.log('Get', data));
await monday.storage.deleteItem('key-test').then((data) => console.log('Delete', data));

Set and get method work correctly:

Set 
{
  "method": "storage",
  "data": {
    "success": true,
    "version": "8b1a9"
  },
  "requestId": "aqi4s0t"
}

Get
{
  "method": "storage",
  "data": {
    "value": "Hello",
    "version": "8b1a9",
    "success": true
  },
  "requestId": "204mmfh"
}

But the deleteItem on produce this error:

Uncaught TypeError: e is undefined
    storage https://cdn.monday.com/build/app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1
    jQuery 6
    h https://cdn.monday.com/build/commons-from-main-668def149da512118db7.js:1
    delete https://cdn.monday.com/build/commons-from-main-668def149da512118db7.js:1
    s https://cdn.monday.com/build/commons-from-main-668def149da512118db7.js:1
    storage https://cdn.monday.com/build/app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1
    storage https://cdn.monday.com/build/app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1
    receiveMessage https://cdn.monday.com/build/app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1
    a https://cdn.monday.com/build/utility_vendor-0b65e737e093f796b528.js:2
    _wrapEventTarget https://cdn.monday.com/build/utility_vendor-0b65e737e093f796b528.js:2
    d https://cdn.monday.com/build/utility_vendor-0b65e737e093f796b528.js:2
    componentDidMount https://cdn.monday.com/build/app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1
    aa https://cdn.monday.com/build/externals-b4bb2147.js:2
    gu https://cdn.monday.com/build/externals-b4bb2147.js:2
    unstable_runWithPriority https://cdn.monday.com/build/externals-b4bb2147.js:2
    $l https://cdn.monday.com/build/externals-b4bb2147.js:2
    vu https://cdn.monday.com/build/externals-b4bb2147.js:2
    ru https://cdn.monday.com/build/externals-b4bb2147.js:2
    ql https://cdn.monday.com/build/externals-b4bb2147.js:2
    unstable_runWithPriority https://cdn.monday.com/build/externals-b4bb2147.js:2
    $l https://cdn.monday.com/build/externals-b4bb2147.js:2
    ql https://cdn.monday.com/build/externals-b4bb2147.js:2
    Kl https://cdn.monday.com/build/externals-b4bb2147.js:2
    ne https://cdn.monday.com/build/externals-b4bb2147.js:2
    qt https://cdn.monday.com/build/externals-b4bb2147.js:2
    a https://cdn.monday.com/build/utility_vendor-0b65e737e093f796b528.js:2
app-feature-iframe-component-5c12cdcbc6ec80efe4af.js:1:53082

When looking at HTTP request:

The DELETE one return an HTTP 204 No content.

Any idea on this issue ?

Also, wanted to use the SDK with script tag to provide a reproduction case, but the current version on cdn.jsdelivr.net doesn’t have the monday.storage.* methods

1 Like

Hello there @clement.devdevils,

Would you be able to please send this over to appsupport@monday.com so we can take a closer look from there?

Looking forward to hearing from you via email!

Cheers,
Matias

2 Likes