Shopify node react installed app data store location

AI-generated summary

Persistence of install data in the Shopify Node/React demo app was clarified: the app does not automatically manage long-term storage for installation state. The key outcome is that the app itself is responsible for storing data such as the shop origin and access token.

  • A database is not strictly mandatory in every architecture.
  • However, if the app needs to retain installation/auth data reliably across restarts, a custom database is the recommended approach.
  • Metafields can be used for app-related data stored on Shopify; private metafields are an option when that data should not be exposed to merchants or other apps.

The original question was effectively resolved with the conclusion that installation details should be persisted by the app, typically in a database, while other admin-side data can be stored in private metafields.

A later update introduced a new unresolved issue: when trying to upload images via the GraphQL stagedUploadsCreate mutation, an “access denied” error occurred. As a workaround, uploading the image as a theme asset was being considered, though that would limit availability to the currently active theme.

Hello,

I am using https://github.com/Shopify/shopify-demo-app-node-react and I was wondering where is the install data persisted in the app? or is It even necessary?

Regards,

Robert

Hi @RobertDev

Hope you’re having a great day!

Useful resources:

How to store app configuration values?

Hello,

Thank you for your response, but that does not answer my question. I was aware of the fact that databases might be needed but I am not sure of the fact that they are required.

Will the node-react app keep track of active installation without the database? or is it stored in memory and will be lost when app restarts (doesn’t seem so from what I checked).

Regards,

Robert

Hi @RobertDev

Hope you’re having a great day!

I was aware of the fact that databases might be needed but I am not sure of the fact that they are required.

Databases are not required. It all depends on your needs and what you want to design. You may want to add a database to your app or depending on what data you are storing you could use metafields.

Merchants and other apps can retrieve and edit the data that’s stored in metafields from the Shopify admin. If you want to use metafields to store data, but you don’t want merchants or other apps to access that data, then you can use private metafields.

Will the node-react app keep track of active installation without the database? or is it stored in memory and will be lost when app restarts (doesn’t seem so from what I checked).

If you want to store data, like shop origin or accessToken and other custom data, you should use a custom database.

To summarizing, Your app is responsible for storing its own information.

If you found this comment useful, hit the ‘Like’ and ‘Accepted solution’ buttons.

Hello,

After a couple of threads read I came to the conclusion that a database will be required to store the initial installation shop and accessToken.

Other data related to my admin backend I store in private metafields as you outlined in your response!

Now I am at the part of storing images with StagedUploadsCreate mutation but I get a “StagedUploadsCreate access denied” for some odd reason. To bypass this I will upload the image as a theme asset I think and it will be available for the current active theme unfortunately… because StagedUploadsCreate is denied for some reason. :disappointed_face: :disappointed_face:

Thank you for your time and effort in responding to my question!

Regards,

Robert