Malonlin SDK Docs

Welcome to the Malonlin SDK

You can bring Malonlin storefront capabilities into your app without bringing along the full website UI. This TypeScript SDK gives you a friendly cart and checkout API, an event listener for useful moments, and access to the complete GraphQL operation catalog used by the web app.

A good place to begin#

  1. Install and connect the package to your Malonlin backend.
  2. Set up your shared marketplace account and standalone app.
  3. Follow the first store walkthrough to create a store and a draft product.
  4. Plan the complete store launch for your catalog, team, fulfillment, and payments.
  5. Explore the wallet guide before handling money.
  6. Explore the cart and checkout API.
  7. Use the operation catalog for the rest of the website's API features.
  8. Connect store members and management.
  9. Explore events and webhooks.
  10. Take a moment with security and flow locks before handling payments.
ts
import { CartSDK } from 'malonlin-sdk';

const sdk = new CartSDK({
  endpoint: 'https://your-api.example/graphql',
});

sdk.on('cart:synced', (cart) => {
  console.log('Your cart is up to date:', cart.items);
});

What the SDK does#

  • Talks to the NestJS GraphQL API used by the Malonlin web app.
  • Keeps the public API independent of React, Redux, and browser storage.
  • Provides first-class cart and wallet-checkout helpers.
  • Emits typed events for cart synchronization, checkout, and requests.
  • Manages the backend's signed outbound webhook subscriptions and delivery history.
  • Includes the web app's named GraphQL operations for auth, stores, wallet, subscriptions, account settings, and other storefront features.

A small but important note#

The SDK is a helpful client, not a security boundary. Your backend makes the final decisions about identity, permissions, prices, stock, and payments. The security guide explains which safeguards live in each place.

Malonlin SDK documentation