Shopify custom session storage in SQL with Prisma

The easiest way how to create a Shopify app is using the CLI tool provided by Shopify. A simple shopify create command sets you up with a boilerplate-but-functional app and you’re ready to go.

One of the first things you’ll need to do is to create a persistent session storage mechanism. The boilerplate app only comes with an in-memory storage. This gist shows one way how to build it, using Prisma as the model layer. It’s pretty straightforward, but it took me a while to figure out some kinks. I hope someone else will find it useful.

The way how the Shopify Node library is handling session is still being improved – I’ll update the gist as the new version is released.

Share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s