Home

Awesome

Shopify API and app tools for JavaScript

This repository contains packages you can use to interact with Shopify's APIs. You can use these packages to create clients for those APIs directly, or to create apps using TypeScript / JavaScript.

It is organized as a monorepo, which includes multiple packages that can be used together.

Packages

The packages in this repository can be used to extend Shopify in different ways:

API clients

These packages make it easy to interact with Shopify's APIs if you have the required access tokens.

PackageLatest versionDescription
@shopify/admin-api-clientLatest badgeClient for the GraphQL and REST Admin APIs.
@shopify/storefront-api-clientLatest badgeClient for the GraphQL Storefront API.
@shopify/graphql-clientLatest badgeGeneric GraphQL API client.
@shopify/api-codegen-presetLatest badgeCodegen preset for Shopify APIs. Automatically integrates with the clients above.

Apps and middlewares

These packages make it easy to create Shopify apps with TS / JS using different tech stacks.

PackageLatest versionDescription
@shopify/shopify-apiLatest badgeFramework and runtime agnostic library for Shopify OAuth, APIs, webhooks, and more.
@shopify/shopify-app-remixLatest badgeImplementation of @shopify/shopify-api to make it easy to create apps using Remix.
@shopify/shopify-app-expressLatest badgeImplementation of @shopify/shopify-api to make it easy to create apps using Express.

Session storage

These packages provide database-specific implementations to manage @shopify/shopify-api sessions.

PackageLatest versionDescription
@shopify/shopify-app-session-storageLatest badgeProvides the interfaces used by the app middleware packages to write custom packages.
@shopify/shopify-app-session-storage-drizzleLatest badgeDrizzle implementation of the session storage interface.
@shopify/shopify-app-session-storage-dynamodbLatest badgeDynamoDB implementation of the session storage interface.
@shopify/shopify-app-session-storage-kvLatest badgeCloudflare KV implementation of the session storage interface.
@shopify/shopify-app-session-storage-memoryLatest badgeMemory implementation of the session storage interface.
@shopify/shopify-app-session-storage-mongodbLatest badgeMongoDB implementation of the session storage interface.
@shopify/shopify-app-session-storage-mysqlLatest badgeMysql implementation of the session storage interface.
@shopify/shopify-app-session-storage-postgresqlLatest badgePostgreSQL implementation of the session storage interface.
@shopify/shopify-app-session-storage-prismaLatest badgePrisma implementation of the session storage interface.
@shopify/shopify-app-session-storage-redisLatest badgeRedis implementation of the session storage interface.
@shopify/shopify-app-session-storage-sqliteLatest badgeSQLite implementation of the session storage interface.

Developing in this repo

We use pnpm to develop this package, and we recommend using it for development to ensure your environment is consistent with ours.

To get started, install the dependencies, and build the packages:

cd shopify-app-js
pnpm install
pnpm build

Once the packages are built, you'll be able to make changes. Note that if you're working on multiple packages, you'll need to build them for changes to affect other packages.

We aim to add test coverage for every change to help prevent regressions. You can run the whole suite by running this at the root:

pnpm test

[!NOTE] Make sure to run build before test to ensure the internal dependencies are available.

If you're only working on one package, you can build and run tests individually:

cd packages/<package>
pnpm build
pnpm test

When you're ready to test a package in an app, you can build it, and install it with a file: protocol in e.g. a Remix app:

cd packages/<package>
pnpm build

cd <app folder>
pnpm add "file:<path to shopify-app-js>/packages/<package>"
shopify app dev

To update the local package, run pnpm build in the package folder, and restart your app.