Saving addon settings in the db

Hey everyone,

I’m testing out some possibilities of the cloud apps (built with ACE) and I’ve stumbled upon something that bugs me. The ACE has the possibility of storing the addon settings from the instance to a table in the database called AddonSettings.

So, in my installed lifecycle route I’m saving those settings with:

addon.settings.set('clientInfo', req.body, req.body.clientKey);

The reason why I’m doing that is because I’ve noticed that when I try to uninstall my app, it says: “Could not find stored client data for xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx. Is this client registered?”, so I assumed it had to have a database row. The app is free for now but will probably get a paid version too.

So, the main questions is: do I have to save that data to the database (both for free and paid versions) and if not, are there any advantages to saving it?

Thanks in advance :wink:

If you’re using ACE - then this should be done on the already existing /installed end point for you.

As far as benefits of having it - if you’re doing backend requests to the Jira instance - you’ll need to have the sharedSecret that comes through the installation hook.


In addition to what Daniel said: If you don’t need to call the host products REST API you can set the authentication to none in your descriptor and get rid of the lifecycle hooks as well. But usually you’ll want to interact with the REST API from your backend at some point. :slight_smile:

The saving itself worked for some time and then it stopped so I added this line as it was easier than debugging what went wrong.

As for the question itself, I think that confirms my initial thoughts that we need to store it in the DB as we do have some backend requests.

Thank you!