Where do I save app settings?

Solved
Highlighted
Shopify Partner
3 0 0

Hi,

I am trying to wrap my head around the app development.
I want to develop a relatively trivial app that injects some js to each page of the online store.
I went through this tutorial: https://shopify.dev/tutorials/build-a-shopify-app-with-node-and-react

And it is clear enough, but it skips the most important step... Saving app settings! It just stores them to the localStorage and assumes everyone knows how and where to store them. 

 

For example on this page: https://shopify.dev/tutorials/build-a-shopify-app-with-node-and-react/build-your-user-interface-with...

They add a "Discount" text field and a toggle. But how and where do I save them?

Do I do a GraphQL mutation call or do I need to set up a DB on my own server to handle this?

If former, which endpoints should I use? privateMetafieldUpsert?

Thanks!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 140 165

This is an accepted solution.

Hey @Tadas 

 

I want to develop a relatively trivial app that injects some js to each page of the online store.

Take a look at ScriptTags. https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag?api[version]=2020-04

 

but it skips the most important step... Saving app settings! Do I do a GraphQL mutation call or do I need to set up a DB on my own server to handle this?

For app settings, your own DB would be best.

 

1 Like