Shopify / shopify-app-template-node

MIT License
869 stars 391 forks source link

Missed getSessionFromStorage #1210

Closed molotow11 closed 1 year ago

molotow11 commented 1 year ago

Issue summary

Can't find a way how to use getSessionFromStorage function how explained here https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/session-storage.md

Expected behavior

Get session object

Actual behavior

Can't find a way how to use it

Steps to reproduce the problem

Try to get session from like with await getSessionFromStorage(sessionId); In documentation we have this words: // use sessionId to retrieve session from app's session storage // getSessionFromStorage() must be provided by application But, how I can use it? I've checked shopify-app-session-storage-mongodb I am using, but there is no such function and only loadSession function exists.

Specifications

mkevinosullivan commented 1 year ago

getSessionFromStorage() is just an example method name and, as the comment in the guide says, is something that must be provided by the app.

If choosing to use any of the shopify-app-session-storage-* packages, then loadSession is the equivalent actual method provided by those packages, as detailed by the SessionStorage interface.