carstenlebek/shopify-non-embedded-app-template

Concerns about Redis and Middleware

aimproxy opened this issue · 2 comments

Hi, firstly I want to thank you all for the amazing job done here. I personally wanted to build a non-embedded app and I just started in de middle, I am a bit lost with Shopify Docs, but I am getting ahead thanks to your repo!

I understand that the repo is maintained frequently, due to the last month commit! But there is a matter that I want to discuss with you guys. As you do store your session storage on Redis, I do the same thing. So I was wondering if CustomeSessionStorage could be replaced by RedisSessionStorage?

Another issue, this time addressing the middleware, could Shopify.Utils.loadCurrentSession be used to the job? Instead of going looking for cookies? Isn't that what this function is all about? Correct me if I am wrong!

Thx for your, keep up your amazing work guys!

Hi, great to hear, that it helps you.

The custom session storage is needed to initialize the shopify-api package.

Regarding the middleware, the session id is stored in the cookie and the session is directly fetched from the redis db. The reason for this is, that the shopify-api library can't be used in middleware, as the library uses native node functions, which are not supported in middleware.

Hmm, I guess that was the trouble with the fs package that I encounter... Thanks for your time!