DEV Community

Discussion on: How to store user data in Shopify App ?

 
memahesh profile image
Medam Mahesh

What about metafields at store level ? Would it work ?

Thread Thread
 
brandinchiu profile image
Brandin Chiu

That's for storing data related to an object. It would be an inappropriate place to store customer data.

Thread Thread
 
memahesh profile image
Medam Mahesh

Using Customer API is not an option for me. As the data I want to save is about the store itself (Here, Shopify store is my customer, not the people who buy at store).

Thread Thread
 
brandinchiu profile image
Brandin Chiu

What information are you looking to persist?

Thread Thread
 
memahesh profile image
Medam Mahesh

An api_key from a third-party service for the store

Thread Thread
 
brandinchiu profile image
Brandin Chiu

That would probably be a bad idea. if I remember correctly, metafields are considered a public object, which means any sensitive data should not be stored on them.

An authorization key for another service is very likely not something you would want to be publicly accessible.

You're going to need your own database to link these two records together (this API key and the shopify store).

Thread Thread
 
memahesh profile image
Medam Mahesh

I read something about metafields saying that they can be made private. And then they will only be accessible to the corresponding app only.

Thread Thread
 
brandinchiu profile image
Brandin Chiu

Maybe my information is out of date or incorrect then.