I want to save the access token of a shopify store and shop name in a variable of in a database when someone installs the app on his store. I am using Nodejs boilerplate. I am unable to get the access token to call an api when a webhook is received.
Thanks
Hello @haseebintegriti
Recently, Shopify provides App Template. So you should migrate from Nodejs boilerplate to Shopify App Template.
Nodejs Shopify app template is already handling to save the access token into the database on installation of the app to any store.
To view the database we can use DB Brower SQLight.
We can access details from the database using res.locals.shopify.session and while making an admin api call from the server end e.g to call an api when a webhook call is received you can simply fetch the access token from the database.
We need to handle the database while installation we need to check the database using the shop name if it is already exist in it then we will just update the access token every time the app is installed on any shopify store.