npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

shopify_storefront_sdk

v1.0.4

Published

A fully typed Node.js + TypeScript SDK for the Shopify Storefront GraphQL API.

Readme

📦 Shopify Storefront SDK (Node.js + TypeScript)

A fully typed, lightweight, and developer-friendly Node.js SDK for the Shopify Storefront GraphQL API.
Built with TypeScript, GraphQL Codegen, and graphql-request — designed to help developers move faster when building Shopify headless storefronts.

✔ Fully typed queries & responses
✔ Simple, intuitive API
✔ Pre-built operations (Products, Carts, Customers, Blogs, Articles…)
✔ Works with Node.js, Next.js, Remix, Cloudflare Workers & more
✔ Supports custom GraphQL queries
✔ Automatic code generation


🔧 Installation

npm install shopify-storefront-sdk
# or
yarn add shopify-storefront-sdk
# or
pnpm add shopify-storefront-sdk

🚀 Quick Start

import { ShopifyStorefront } from "shopify-storefront-sdk";

const shopify = new ShopifyStorefront({
  domain: process.env.SHOPIFY_STORE_DOMAIN!,
  token: process.env.SHOPIFY_STOREFRONT_TOKEN!,
});

// Fetch a product
const product = await shopify.getProductById(
  "gid://shopify/Product/1234567890"
);

console.log(product.title);

📘 Features

  • Typed SDK methods:

    • Products (ID, handle, collections)
    • Recommendations
    • Blogs & articles
    • Carts (create/get/update)
    • Customers (create, login, recovery flow)
  • GraphQL Codegen built in

  • Consistent error handling

  • Supports custom queries

  • Zero heavy dependencies


🧩 SDK API Overview

Initialize Client

const shopify = new ShopifyStorefront({
  domain: "yourstore.myshopify.com",
  token: "your-storefront-access-token",
});

Products

Get product by ID

await shopify.getProductById(productId);

Get product by handle

await shopify.getProductByHandle("my-product");

Recommendations

await shopify.getProductRecommendations(productId);

Carts

Create a cart

await shopify.createCart({
  lines: [{ merchandiseId: "...", quantity: 1 }],
});

Get cart

await shopify.getCart(cartId);

Customers

await shopify.createCustomer({ email, password });
await shopify.sendResetEmail(email);
await shopify.verifyToken(token);

Blogs & Articles

await shopify.getBlog("news", 10);

📁 Project Structure

/src
  /queries        → .graphql operations
  /generated      → Auto-generated code
  index.ts        → SDK export

/codegen.yml       → Codegen config
/schema.graphql    → Shopify schema

🛠 Development Setup

git clone https://github.com/YOUR_USERNAME/shopify-storefront-sdk.git
cd shopify-storefront-sdk
npm install

Create a .env file:

SHOPIFY_STORE_DOMAIN=yourstore.myshopify.com
SHOPIFY_STOREFRONT_TOKEN=xxxx

🔨 Build

npm run build

Outputs:

dist/index.js
dist/index.cjs
dist/index.d.ts

🧪 Testing

npm run dev
# after build:
npm run test

🧬 Code Generation

Regenerate types & operations:

npm run generate

Scans:

src/queries/*.graphql
schema.graphql

Generates:

src/generated/

🌐 Requirements

  • Node.js 18+
  • Storefront API token
  • Public or development Shopify store

🤝 Contributing

Pull requests are welcome!

  1. Fork the repo
  2. Create a branch: git checkout -b feature/my-feature
  3. Commit & push
  4. Submit a PR

📜 License

MIT License — free for commercial and personal use.


⭐ Support

If this SDK saves you time, please star ⭐ the repository— it helps others discover it and motivates future improvements!



If you want, I can also generate:

✅ Better badges (npm version, downloads, license, TypeScript)
✅ CONTRIBUTING.md
✅ API documentation table
✅ Full GitHub project template (issues, PR templates, workflows)