Custom session storage using Node code from CLI 3.x

Topic summary

Main issue: After moving to Shopify CLI 3.x, the previous Shopify.Session.CustomSessionStorage constructor is gone, and developers need guidance to implement custom session storage (now requiring deleteSessions and findSessionsByShop in addition to existing handlers).

Key points:

Notes:

  • One reply about the Partner “Team” tab and permissions was off-topic for this technical issue.

Outcome/status:

  • A concrete solution and official documentation link were provided, clarifying how to implement custom session storage under CLI 3.x. The discussion is effectively resolved.
Summarized with AI on January 27. AI used: gpt-5.

I’m moving our app code into the app framework generated by Shopify CLI 3.x . I can’t find any documentation on how to implement custom session storage. The way we we’re doing it is:

const sessionStorage = new Shopify.Session.CustomSessionStorage(
myStoreCallback,
myLoadCallback,
myDeleteCallback
);

I know that there are two new handlers required (deleteSessions, findSessionsByShop) but cannot find how to create the SessionStorage object as Shopify.Session.CustomSessionStorage constructor no longer exists.

If there is any documentation available please provide a link; failing that please tell me how to create the custom session storage object.

Many thanks!

1 Like

I have the same issue. It’s really tough having to keep up with changes to the api without sufficient documentation.

Turns out there’s a tab under partner interface called “Team”

You could give another dev permission to the app you are building.

That’s not answering the actual problem.

@dbleeker Here’s what I did. Created a CustomSessionStorage class:

export class CustomSessionStorage {
  async storeSession(session) {...}

  async loadSession(id) {...}

  async deleteSession(id) {...}

  async deleteSessions(ids) {...}

  async findSessionsByShop(shop) {...}
}

Create an instance in your shopify config:

sessionStorage: new CustomSessionStorage()

All return values for the class methods are described here: https://github.com/Shopify/shopify-app-js/blob/main/packages/shopify-app-session-storage/implementing-session-storage.md

Good luck :slightly_smiling_face: