How can I make sure a function is ran only once when it's installed for the 1st time in a store?

How can I make sure a function is ran only once when it's installed for the 1st time in a store?

Wakil_eFoli
Shopify Partner
45 2 5

I've some functions to create metafield definitions that I want them to run only once when the app is being installed for the 1st time in a store and then run some other functions when the app is being uninstalled.

How can I do that? TIA. 

Reply 1 (1)

Wakil_eFoli
Shopify Partner
45 2 5

For your information I'm using an Remix App.