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

@alphabite/medusa-sdk

v0.6.15

Published

Extended Medusa utility sdk client, that adds Alphabite's plugins endpoints

Readme

⚙️ Alphabite Medusa Sdk

npm version npm downloads MIT License Types Included

Drop-in replacement for @medusajs/js-sdk with plugin support for Wishlists, PayPal, Reviews, and more.

The Alphabite Medusa Sdk wraps the Medusa JS SDK and adds support for rich frontend integrations via plugin architecture.


📚 Table of Contents


📦 Installation

npm install @alphabite/medusa-sdk

🚀 Usage

import {
  AlphabiteMedusaSdk,
  wishlistPlugin,
  paypalPlugin,
  reviewsPlugin,
} from '@alphabite/medusa-sdk'

const sdk = new AlphabiteMedusaSdk(
  {
    baseUrl: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api',
    debug: process.env.NODE_ENV === 'development',
    publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
  },
  [wishlistPlugin, paypalPlugin, reviewsPlugin],

  // Optional options config to add a global getAuthHeader function for all endpoints
  {
    // supports async functions, for example a server action that fetches the token from headers
    getAuthHeader: async () => {
      const token = await getToken(); // your own function that returns the auth token

      return {
        authorization: `Bearer ${token}`,
      }
    },
  }
)

🔁 Drop-in Replacement

To migrate from the default Medusa SDK:

// BEFORE
import Medusa from '@medusajs/js-sdk'
const sdk = new Medusa({
  baseUrl: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api',
  debug: process.env.NODE_ENV === 'development',
  publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
})

// AFTER
import { AlphabiteMedusaSdk, wishlistPlugin } from '@alphabite/medusa-sdk'

const sdk = new AlphabiteMedusaSdk({
    baseUrl: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api',
    debug: process.env.NODE_ENV === 'development',
    publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
  },
  [wishlistPlugin], {
    // supports async functions, for example a server action that fetches the token from headers
    getAuthHeader: async () => {
      const token = await getToken(); // your own function that returns the auth token

      return {
        authorization: `Bearer ${token}`,
      }
    },
  }
)

🔌 Plugin Injection

Pass an array of plugins as the second argument:

[wishlistPlugin]

Each plugin registers a namespace like:

sdk.alphabite.wishlist

🔐 Auth Handling

1. Global headers with getAuthHeader

const sdk = new AlphabiteMedusaSdk(
  { baseUrl },
  [wishlistPlugin],
  {
    // supports async function, for example a server action that fetches the token from headers
    getAuthHeader: async () => {
      const token = await getToken(); // your own function that returns the auth token

      return {
        authorization: `Bearer ${token}`,
      }
    },
  }
)

2. Per-request headers

await sdk.alphabite.wishlist.create({ name: 'Favorites' }, {
  'x-request-id': 'abc',
})

✅ Example: Wishlist Usage

await sdk.alphabite.wishlist.create({ name: 'My Sneakers' })

await sdk.alphabite.wishlist.addItem({
  id: 'wishlist_id',
  product_id: 'variant_id',
})

const { data: items } = await sdk.alphabite.wishlist.listItems({
  id: 'wishlist_id',
})

🧩 Plugins Included

| Plugin | Namespace | Description | |---------------|-------------------|-------------------------------------| | wishlist | sdk.alphabite.wishlist | Multi-wishlist system | | reviews | sdk.alphabite.reviews | Reviews | | paypal | sdk.alphabite.paypal | Paypal |


🧪 TypeScript Support

Includes full types for every plugin endpoint:

  • Wishlist, WishlistItem, AddItemToWishlistInput, etc.
  • Fully typed SDK, request bodies, and responses

📁 Folder Structure Tip

Create a central instance:

// lib/sdk.ts
import {
  AlphabiteMedusaSdk,
  wishlistPlugin,
} from '@alphabite/medusa-sdk'

export const sdk = new AlphabiteMedusaSdk(
  { baseUrl: process.env.NEXT_PUBLIC_API_URL! },
  [wishlistPlugin],
  {
    // supports async function, for example a server action that fetches the token from headers
    getAuthHeader: async () => {
      const token = await getToken(); // your own function that returns the auth token

      return {
        authorization: `Bearer ${token}`,
      }
    },
  }
)

Use across your app:

import { sdk } from '@/lib/sdk'

await sdk.alphabite.wishlist.list({ limit: 10 })

🤝 Contributing

Want to build plugins or extend core support? PRs are welcome!


📝 License

MIT © Alphabite — extend and use freely.