shopify-sequelize-session-storage
v1.0.5
Published
Sequeilze session store for Shopify app
Downloads
9
Readme
Sequelize Session Storage
Sequelize session store for Shopify app
Usage
import { sequelizeStorage } from "shopify-sequelize-session-storage";
import connection from "./database/connection.js";
const {
storeCallback,
loadCallback,
deleteCallback,
deleteSessionsCallback,
findSessionsByShopCallback,
} = sequelizeStorage(connection);
...
Shopify.Context.initialize({
API_KEY: process.env.SHOPIFY_API_KEY,
API_SECRET_KEY: process.env.SHOPIFY_API_SECRET,
SCOPES: process.env.SCOPES.split(","),
HOST_NAME: process.env.HOST.replace(/https?:\/\//, ""),
HOST_SCHEME: process.env.HOST.split("://")[0],
API_VERSION: LATEST_API_VERSION,
IS_EMBEDDED_APP: true,
// Use sequelize session storage here
SESSION_STORAGE: new Shopify.Session.CustomSessionStorage(
storeCallback,
loadCallback,
deleteCallback,
deleteSessionsCallback,
findSessionsByShopCallback,
),
});