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#
- Install and connect the package to your Malonlin backend.
- Set up your shared marketplace account and standalone app.
- Follow the first store walkthrough to create a store and a draft product.
- Plan the complete store launch for your catalog, team, fulfillment, and payments.
- Explore the wallet guide before handling money.
- Explore the cart and checkout API.
- Use the operation catalog for the rest of the website's API features.
- Connect store members and management.
- Explore events and webhooks.
- 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.