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

@itonomy/magento

v0.1.5

Published

Reusable Magento integration module for Nuxt 4 applications.

Readme

@itonomy/magento

Reusable Magento integration module for Nuxt 4 applications.

Development

Local development (using source)

During development, you may want to use the package directly from its source instead of the published version. This allows instant updates without rebuilding or publishing In your Nuxt app (Main App) package.json:

{
  "dependencies": {
    "@itonomy/magento": "portal:../frontend-modules/packages/magento"
  }
}

Then install dependencies:

pnpm install
or
yarn install

Important

  • In development, the package should expose source files (src) instead of dist
  • This enables Nuxt to process the module correctly (auto-imports, composables, etc.)
  • Changes in the Magento module will be reflected immediately without rebuild

⚠️ Important (Magento package requirement)

{
  "exports": {
    ".": {
     "types": "./dist/module.d.ts",
      "import": "./src/module.ts" // add this for development build
      // "import": "./dist/module.mjs" // remove it for development build
    }
  }
}

Production usage (published package)

{
  "dependencies": {
    "@itonomy/magento": "^0.1.3"
  }
}

What it provides

  • Nuxt module registration with defineNuxtModule
  • auto-imported Magento composables such as useMagento
  • Nitro server handlers for /api/magento/graphql and /api/magento/rest/*
  • reusable Magento runtime and API types

Build

pnpm install
pnpm --filter @itonomy/magento build

Playground (GraphQL test)

This module includes a Nuxt playground to test Magento GraphQL requests locally.

  1. Copy the example env file:
cp packages/magento/playground/.env.example packages/magento/playground/.env
  1. Update Magento endpoints in .env.
  2. Run the playground:
pnpm dev:playground

From the playground UI you can test:

  • Registered operation (storeConfig, products, etc.)
  • Custom GraphQL query
  • Custom GraphQL mutation

All requests are sent to POST /api/magento/graphql.

Playground sample data

1) Registered Operation - storeConfig

  • Mode: Registered Operation
  • Operation: storeConfig
  • Variables (JSON):
{}

2) Registered Operation - products

  • Mode: Registered Operation
  • Operation: products
  • Variables (JSON):
{
  "search": "shirt",
  "filter": {
    "price": {
      "from": "10",
      "to": "120"
    }
  },
  "currentPage": 1,
  "pageSize": 5
}

3) Custom Query - products

  • Mode: Custom Query
  • Query:
query Products($search: String, $currentPage: Int, $pageSize: Int) {
  products(search: $search, currentPage: $currentPage, pageSize: $pageSize) {
    total_count
    items {
      uid
      sku
      name
      stock_status
      price_range {
        minimum_price {
          final_price {
            value
            currency
          }
        }
      }
    }
  }
}
  • Variables (JSON):
{
  "search": "shirt",
  "currentPage": 1,
  "pageSize": 5
}

4) Custom Mutation - createEmptyCart

  • Mode: Custom Mutation
  • Mutation:
mutation CreateEmptyCart {
  createEmptyCart
}
  • Variables (JSON):
{}

5) Registered Operation - productDetails with extraVariableDeclarations and extraSelections

  • Mode: Registered Operation
  • Operation: productDetails
  • extraVariableDeclarations:
, $warehouseCode: String
  • extraSelections:
warehouse_stock(warehouse_code: $warehouseCode) {
  qty
  is_in_stock
}
  • Variables (JSON):
{
  "urlKey": "example-product-slug",
  "warehouseCode": "WH-NL-01",
  "productReviewsPageSize": 5,
  "productReviewsPage": 1
}

6) Registered Operation - getProductAttributes with extraVariableDeclarations and extraSelections

  • Mode: Registered Operation
  • Operation: getProductAttributes
  • extraVariableDeclarations:
, $entityType: String
  • extraSelections:
frontend_input
entity_type
  • Variables (JSON):
{
  "attributes": [{ "attribute_code": "color" }, { "attribute_code": "size" }],
  "entityType": "catalog_product"
}

Note: extraVariableDeclarations and extraSelections are applied only for operations that include placeholders in the query template. In this module, that is currently productDetails and getProductAttributes.

{
  "exports": {
    ".": {
      "types": "./dist/module.d.ts",
      // "import": "./src/module.ts" remove it for production build
      "import": "./dist/module.mjs" // add this for production build
    }
  }
}

Use in a Nuxt app

export default defineNuxtConfig({
  modules: ['@itonomy/magento'],
  magento: {
    graphqlUrl: process.env.MAGENTO_GRAPHQL_URL,
    restUrl: process.env.MAGENTO_REST_URL,
    baseUrl: process.env.MAGENTO_BASE_URL,
    defaultStore: 'default',
  },
})

Runtime type imports

import type { ProductDetailsItem } from '@itonomy/magento/runtime/types'

Notes

This package was extracted from the storefront app with minimal behavior changes to preserve the existing integration first.