open-index/open-npm huggingface dataset:
npm package: @shopify/sewing-kit-plugin-quilt
Description: Quilt plugins for sewing-kit
Author: Shopify Inc.
Latest version: 0.4.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@shopify/sewing-kit-plugin-quilt`

This package has been deprecated and removed. Webpack integration into sewing-kit-next shall be revisited once Webpack 5 in sewing-kit classic work is completed.
npm package: @shopify/shop-minis-runtime
Description: The development runtime for Minis
Author: shopify
Latest version: 0.0.140

# shop-minis-runtime

shop-minis-runtime is responsible for guaranteeing that the context of Minis in development matches the context provided by Shop in production.

## Dependencies

Dependencies are provided by Shop itself during production runtime, however, that's not the case when the Mini is executed in a remote setup during development. In those cases, shop-minis-runtime will be the source of truth for which dependencies are available (and which versions they have).

## React context values

React context values are also missing when the Mini is executed in development mode. shop-minis-runtime will expose provider components that mimic the production environment of Shop.

## Metro config

To use the metro config exposed in this package you can use this example `metro.config.js` file:

```js
// metro.config.js
const { getMinisMetroConfig } = require("@shopify/shop-minis-runtime/metro-config");

module.exports = getMinisMetroConfig();
```

## Babel preset

To use the babel preset exposed in this package you can use this example `babel.config.js` file:

```js
// babel.config.js
module.exports = {
  presets: ["@shopify/shop-minis-runtime/babel-preset"],
};
```
npm package: @shopify/shopify-app-session-storage
Description: Shopify App Session Storage - abstract class
Author: Shopify Inc.
Latest version: 5.0.0

# Session Storage

This folder contains the `SessionStorage` interface that the individual [packages](../) for most common databases implement.

See the [`session-storage.ts`](./src/types.ts) file for the methods that need to be implemented, the params they accept and values they return.
npm package: @shopify/shopify-app-session-storage-dynamodb
Description: Shopify App Session Storage for DynamoDB
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for AWS DynamoDB

This package implements the `SessionStorage` interface that works with an AWS DynamoDB database.

Contributed by [Chris](https://github.com/zirkelc) - thank you :clap:

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {DynamoDBSessionStorage} from '@shopify/shopify-app-session-storage-dynamodb';

// You can use the default options
const storage = new DynamoDBSessionStorage();

// or, if you want to use a different session table name and shop index name
const storage = new DynamoDBSessionStorage({ sessionTableName: 'my-session-table', shopIndexName: 'my-shop-index' });

// or, if you want to use a different region or credentials
const storage = new DynamoDBSessionStorage({ config: { region: 'us-west-2', credentials: { ... } } });

const shopify = shopifyApp({
  sessionStorage: storage,
  // ...
});
```

## Table Schema

```js
{
  TableName: sessionTableName,
  AttributeDefinitions: [
    {AttributeName: 'id', AttributeType: 'S'},
    {AttributeName: 'shop', AttributeType: 'S'},
  ],
  KeySchema: [{AttributeName: 'id', KeyType: 'HASH'}],
  GlobalSecondaryIndexes: [
    {
      IndexName: shopIndexName,
      KeySchema: [{AttributeName: 'shop', KeyType: 'HASH'}],
      Projection: {ProjectionType: 'KEYS_ONLY'},
      ProvisionedThroughput: {
        ReadCapacityUnits: 1,
        WriteCapacityUnits: 1,
      },
    },
  ],
  ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1},
}
```

### AWS Policy for DynamoDB

This policy must be attached to a user -- `dynamodb:Query` does not work with inline policies.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Statement1",
      "Effect": "Allow",
      "Action": [
        "dynamodb:GetItem",
        "dynamodb:DeleteItem",
        "dynamodb:PutItem",
        "dynamodb:Query",
        "dynamodb:DescribeTable"
      ],
      "Resource": ["arn:aws:dynamodb:<region>:<account-id>:table/<table-name>"]
    }
  ]
}
```

## Refresh Token Support

This package supports storing refresh tokens for apps using expiring offline access tokens. No migration or schema changes are required. DynamoDB's flexible schema automatically accommodates the additional fields.

To enable expiring offline access tokens in your app:

```js
const shopify = shopifyApp({
  sessionStorage: new DynamoDBSessionStorage(),
  future: {
    expiringOfflineAccessTokens: true,
  },
  // ...
});
```

If you prefer to use your own implementation of a session storage mechanism that uses the `SessionStorage` interface, see the [implementing session storage guide](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-kv
Description: Shopify App Session Storage for KV
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for CloudFlare KV

CloudFlare's [KV](https://www.cloudflare.com/products/workers-kv/) storage can be used on worker runtimes.
Before using it, you'll need to set up a namespace for your sessions and pass in a `KVNamespace` object.
You can do that either when creating an instance of `KVSessionStorage`, or by calling the `setNamespace` method.

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {KVSessionStorage} from '@shopify/shopify-app-session-storage-kv';

const shopify = shopifyApp({
  sessionStorage: new KVSessionStorage(),
  // ...
});

export default {
  async fetch(
    request: Request,
    env: Env,
    ctx: ExecutionContext,
  ): Promise<Response> {
    shopify.config.sessionStorage.setNamespace(env.MY_KV_NAMESPACE);
    // Handle request
  },
};

// OR

import {Miniflare} from 'miniflare';
const mf = new Miniflare({
  kvNamespaces: ['MY_KV_NAMESPACE'],
});
const shopify = shopifyApp({
  sessionStorage: new KVSessionStorage(
    await mf.getKVNamespace('MY_KV_NAMESPACE'),
  ),
  // ...
});
```

## Refresh Token Support

This package supports storing refresh tokens for apps using expiring offline access tokens. No migration or schema changes are required - KV storage automatically preserves all Session fields through JSON serialization.

> [!NOTE]
> The `future.expiringOfflineAccessTokens` flag is available in `@shopify/shopify-app-remix` and `@shopify/shopify-app-react-router` only. It does not apply to `@shopify/shopify-app-express`.

To enable expiring offline access tokens in your app (React Router or Remix):

```js
import {shopifyApp} from '@shopify/shopify-app-react-router';
import {KVSessionStorage} from '@shopify/shopify-app-session-storage-kv';

const shopify = shopifyApp({
  sessionStorage: new KVSessionStorage(),
  future: {
    expiringOfflineAccessTokens: true,
  },
  // ...
});
```

If you prefer to use your own implementation of a session storage mechanism that uses the `SessionStorage` interface, see the [implementing session storage guide](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-memory
Description: Shopify App Session Storage for Memory
Author: Shopify Inc.
Latest version: 6.0.0

# In-Memory Session Storage

This package implements the `SessionStorage` interface to work with an in-memory storage table.

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';

const shopify = shopifyApp({
  sessionStorage: new MemorySessionStorage(),
  // ...
});
```

> **Note**: :warning: This session storage model is for local development only, to make it easier for developers to get started.
> It will delete all sessions if the app process gets restarted or redeployed, and is not meant for production use.
> For persistent storage, use one of the other options (see relevant section above for instructions).

## Refresh Token Support

This package supports storing refresh tokens for apps using expiring offline access tokens. No migration or schema changes are required - memory storage automatically preserves all Session fields including refresh tokens.

To enable expiring offline access tokens in your app:

```js
const shopify = shopifyApp({
  sessionStorage: new MemorySessionStorage(),
  future: {
    expiringOfflineAccessTokens: true,
  },
  // ...
});
```

> **Note**: Remember that this session storage is for local development only and will lose all data when the app restarts.

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](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-mongodb
Description: Shopify App Session Storage for MongoDB
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for MongoDB

This package implements the `SessionStorage` interface that works with an instance of [MongoDB](https://www.mongodb.com/home).

```js
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',
  ),
  // ...
});
```

## Refresh Token Support

This package supports storing refresh tokens for apps using expiring offline access tokens. No migration or schema changes are required. MongoDB's flexible schema automatically accommodates the additional fields.

To enable expiring offline access tokens in your app:

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

If you prefer to use your own implementation of a session storage mechanism that uses the `SessionStorage` interface, see the [implementing session storage guide](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-mysql
Description: Shopify App Session Storage for MySQL
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for MySQL DB

This package implements the `SessionStorage` interface that works with an instance of [MySQL](https://www.mysql.com), using the `mysql.Pool` as the underlying connection resource.

```js
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
  ),
  // ...
});
```

## Expiring Offline Access Tokens

This package supports the storage of refresh tokens and refresh token expiration dates, which enables apps to use [expiring offline access tokens](https://shopify.dev/docs/apps/auth/access-token-types/offline-access-tokens#expiring-offline-access-tokens). The required database columns are added automatically via a migration that runs on the first connection after upgrading.

To enable this feature, set the `future.expiringOfflineAccessTokens` flag in your app configuration:

```typescript
future: {
  expiringOfflineAccessTokens: true,
}
```

For detailed migration instructions, see [MIGRATION_TO_EXPIRING_TOKENS.md](./MIGRATION_TO_EXPIRING_TOKENS.md).

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](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-postgresql
Description: Shopify App Session Storage for PostgreSQL
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for PostgreSQL

This package implements the `SessionStorage` interface that works with an instance of [PostgreSQL](https://www.postgresql.org).
Tested using PostgreSQL v15

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {PostgreSQLSessionStorage} from '@shopify/shopify-app-session-storage-postgresql';

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

// OR

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

// OR

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

## Expiring Offline Access Tokens

This storage adapter supports [expiring offline access tokens](https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/offline-access-tokens#step-7-get-a-new-access-token-exchange). When enabled, the adapter automatically stores and retrieves refresh tokens alongside your session data.

To enable this feature, set the `expiringOfflineAccessTokens` future flag in your app configuration:

```typescript
const shopify = shopifyApp({
  sessionStorage: new PostgreSQLSessionStorage(
    'postgres://username:password@host/database',
  ),
  future: {
    expiringOfflineAccessTokens: true,
  },
  // ... other config
});
```

The required database columns (`refreshToken` and `refreshTokenExpires`) are added automatically via the built-in migration system. For details, see the [migration guide](./MIGRATION_TO_EXPIRING_TOKENS.md).

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](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-redis
Description: Shopify App Session Storage for Redis
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for Redis

This package implements the `SessionStorage` interface that works with an instance of [Redis](https://redis.io/).

You can create an instance of `RedisSessionStorage` in several ways:

## Using a connection URL

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {RedisSessionStorage} from '@shopify/shopify-app-session-storage-redis';

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

## Using a URL object

```js
const shopify = shopifyApp({
  sessionStorage: new RedisSessionStorage(
    new URL('redis://username:password@host/database'),
  ),
  // ...
});
```

## Using credential components

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

## Using a RedisClient instance

> [!NOTE]
> Remember that `RedisSessionStorage` will connect to the database, but won't disconnect from it.
> If you need to restart the connection, you'll need to manually connect again for the storage to continue working.

```js
import {RedisClientOptions, createClient} from 'redis';
const client = createClient({url: 'redis://username:password@host/database'});

const shopify = shopifyApp({
  sessionStorage: new RedisSessionStorage(client),
  // ...
});
```

## Refresh Token Support

This package supports storing refresh tokens for apps using expiring offline access tokens. No migration or schema changes are required - Redis storage automatically preserves all Session fields through JSON serialization.

> [!NOTE]
> The `future.expiringOfflineAccessTokens` flag is available in `@shopify/shopify-app-remix` and `@shopify/shopify-app-react-router` only. It does not apply to `@shopify/shopify-app-express`.

To enable expiring offline access tokens in your app (React Router or Remix):

```js
import {shopifyApp} from '@shopify/shopify-app-react-router';
import {RedisSessionStorage} from '@shopify/shopify-app-session-storage-redis';

const shopify = shopifyApp({
  sessionStorage: new RedisSessionStorage(
    'redis://username:password@host/database',
  ),
  future: {
    expiringOfflineAccessTokens: true,
  },
  // ...
});
```

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](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-app-session-storage-sqlite
Description: Shopify App Session Storage for SQLite
Author: Shopify Inc.
Latest version: 6.0.0

# Session Storage Adapter for SQLite

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

```js
import {shopifyApp} from '@shopify/shopify-app-express';
import {SQLiteSessionStorage} from '@shopify/shopify-app-session-storage-sqlite';
import sqlite3 from 'sqlite3';

// You can construct using either a filename...
const storage = new SQLiteSessionStorage('/path/to/your.db');

// or an existing sqlite3.Database
const database = new sqlite3.Database('/path/to/your.db');
const storage = new SQLiteSessionStorage(database);

const shopify = shopifyApp({
  sessionStorage: storage,
  // ...
});
```

> **Note**: [SQLite](https://sqlite.com) is a local, file-based SQL database. It persists all tables to a single file on your local disk. As such, it’s simple to set up and is a great choice for getting started with Shopify App development. However, it won’t work when your app getting scaled across multiple instances because they would each create their own database.

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](../shopify-app-session-storage/implementing-session-storage.md).
npm package: @shopify/shopify-cli-extensions
Description: A command line tool to build UI extensions
Author: Shopify
Latest version: 3.21.0
Deprecated: Please use @shopify/cli instead.

# Shopify CLI Extensions

The Shopify CLI Extensions command line tool allows you to build a UI Extensions. It comes packaged with [Shopify CLI](https://shopify.github.io/shopify-app-cli/core), so when you create an extension using Shopify CLI's `shopify extension create` command, your project will automatically consume this package.

Start using this tool by creating an extension with [Shopify CLI](https://shopify.github.io/shopify-app-cli/core/#create)

## Installation

When consumed in a project, the command `shopify-cli-extensions` becomes available to the project. The command can be used to build UI Extensions.

To install this package in an UI Extension project, run:

```sh
npm install @shopify/shopify-cli-extensions
```

or

```sh
yarn add @shopify/shopify-cli-extensions
```

## Building a UI Extension for development

You can run the `shopify-cli-extensions serve` to build your extension and automatically trigger a re-build when the source files are changed.

```sh
npm shopify-cli-extensions serve
```

or

```sh
yarn shopify-cli-extensions serve
```

## Building a UI Extension for production

You can run the `shopify-cli-extensions build` to build a minified version of your extension.

```sh
npm shopify-cli-extensions build
```

or

```sh
yarn shopify-cli-extensions build
```

## Getting the extension config

If you are using your own build tools, you can get access to the extension configs by using the `getConfigs` utility provided. This utility will read your extension config and return a JSON object.

```js
import {getConfigs} from '@shopify/shopify-cli-extensions';

const configs = getConfigs();

// TODO: do something with the configs
```