@shopify/shopify-app-session-storage-mysql
TypeScript icon, indicating that this package has built-in type declarations

3.0.5 • Public • Published

Session Storage Adapter for MySQL DB

This package implements the SessionStorage interface that works with an instance of MySQL, using the mysql.Pool as the underlying connection resource.

import {shopifyApp} from '@shopify/shopify-app-express';
import {MySQLSessionStorage} from '@shopify/shopify-app-session-storage-mysql';

const shopify = shopifyApp({
  sessionStorage: new MySQLSessionStorage(
    'mysql://username:password@host/database',
    {connectionPoolLimit: 10}, // optional
  ),
  // ...
});

// OR

const shopify = shopifyApp({
  sessionStorage: new MySQLSessionStorage(
    new URL('mysql://username:password@host/database'),
    {connectionPoolLimit: 10}, // optional
  ),
  // ...
});

// OR

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

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.

Package Sidebar

Install

npm i @shopify/shopify-app-session-storage-mysql

Weekly Downloads

550

Version

3.0.5

License

MIT

Unpacked Size

99.3 kB

Total Files

28

Last publish

Collaborators

  • jaimie.rockburn
  • blittle
  • shopify-admin
  • maryharte
  • crisfmb
  • pmoloney89
  • netlohan
  • st999999
  • justin-irl
  • megswim
  • wcandillon
  • nathanpjf
  • shopify-dep
  • goodforonefare
  • lemonmade
  • vsumner
  • wizardlyhel
  • antoine.grant
  • tsov
  • andyw8-shopify
  • henrytao
  • hannachen
  • vividviolet
  • bpscott