Skip to content

Latest commit

 

History

History

shopify-app-session-storage-mongodb

Session Storage Adapter for MongoDB

This package implements the SessionStorage interface that works with an instance of MongoDB.

import {shopifyApp} from '@shopify/shopify-app-express';
import {MongoDBSessionStorage} from '@shopify/shopify-app-session-storage-mongodb';

const shopify = shopifyApp({
  sessionStorage: new MongoDBSessionStorage(
    'mongodb://username:password@host/',
    'database',
  ),
  // ...
});

// OR

const shopify = shopifyApp({
  sessionStorage: MongoDBSessionStorage.withCredentials(
    'host.com',
    'thedatabase',
    'username',
    'password',
  ),
  // ...
});

If you prefer to use your own implementation of a session storage mechanism that is compatible with the @shopify/shopify-app-express package, see the implementing session storage guide.