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

malonlin-sdk

v0.1.1

Published

Framework-agnostic TypeScript SDK for the Malonlin storefront API

Readme

Malonlin SDK

The Malonlin SDK gives TypeScript and JavaScript applications a clear, framework-agnostic way to work with the Malonlin storefront API. It includes a cart and checkout client, typed request and event APIs, and the same named GraphQL operations used by the Malonlin web app.

The package is published on npm as malonlin-sdk.

Install

npm install malonlin-sdk

A gentle start

import { CartSDK } from "malonlin-sdk";

const sdk = new CartSDK({
  endpoint: "https://your-api.example/graphql",
  apiKey: process.env.MALONLIN_API_KEY,
});

sdk.on("cart:synced", (cart) => {
  console.log("Cart synced:", cart.items);
});

const cart = await sdk.getCart({ userId: "user-id", currencyCode: "ZAR" });

CartSDK also exposes cart synchronization, item updates, coupon helpers, checkout readiness, and checkout. Domain clients cover sdk.auth, sdk.account, sdk.settings, sdk.stores, sdk.members, sdk.products, sdk.wanted, sdk.coupons, sdk.orders, sdk.analytics, sdk.scheduledOrders, sdk.serviceBookings, sdk.wallet, sdk.contacts, sdk.ratings, sdk.communications, sdk.subscriptions, sdk.apiSubscriptions, sdk.digitalPurchases, sdk.webhooks, and sdk.uploads.

const members = await sdk.members.listMembers(storeId, memberId);
const wallet = await sdk.wallet.getUserWallet(userId, "ZAR");
const products = await sdk.products.publicStoreProducts(storeId, "ZAR");
const requests = await sdk.wanted.list({
  type: "SERVICE",
  search: "Honda Civic",
});
const request = await sdk.wanted.create({
  type: "SERVICE",
  title: "Engine swap for a Honda Civic",
  description: "Looking for an experienced local mechanic for an engine swap.",
  location: "Cape Town",
  budgetMax: 25000,
  currencyCode: "ZAR",
});
const result = await sdk.communications.subscribeNewsletter(
  "[email protected]",
);

const webhook = await sdk.webhooks.create({
  storeId,
  name: "Order notifications",
  endpointUrl: "https://merchant.example/webhooks/malonlin",
  eventTypes: ["payment.completed"],
});
// Save webhook.secret when returned; the backend only shows it once.

Ready-to-use clients cover the website's common product, order, analytics, settings, store, scheduled-order, service-booking, wallet, and membership flows, including buyer receipt confirmation and seller digital-sales history. For any additional named GraphQL operation, call sdk.execute(...) or use sdk.request(...) with an exported query. See the SDK docs site for feature and security guides.

Website media uploads use the same-origin multipart route:

const uploaded = await sdk.uploads.upload(file, {
  folder: "products",
  fileName: file.name,
});

See the feature-client reference for method coverage and the events/webhooks guide for all local SDK events, backend webhook types, and website-only React hooks.

Framework-agnostic API operations

Every named GraphQL operation from the web app is available from the package. This keeps additional web features accessible without a React, Redux, or browser-storage dependency:

import { CartSDK, USER_PROFILE_GET_USER_ORDERS } from "malonlin-sdk";

const sdk = new CartSDK({ endpoint: "https://your-api.example/graphql" });
const result = await sdk.request({
  query: USER_PROFILE_GET_USER_ORDERS,
  variables: { userId: "user-id", page: 1, limit: 20 },
});

You can also import operations from malonlin-sdk/operations.

Security in one sentence

The SDK helps callers follow the right flow; the backend remains the authority for identity, ownership, prices, inventory, payment, and idempotency. Never put a private API key in a browser bundle.