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

@manifoldxyz/client-sdk

v1.0.0

Published

Manifold Client SDK for headless purchasing and display of Manifold products

Downloads

540

Readme

Manifold Client SDK

The Manifold Storefront SDK enables headless purchasing and display of Manifold products.

Head to studio.manifold.xyz to launch your product, then build your own UI and use the SDK to seamlessly integrate product purchasing into your application.

Full Documentation

✨ Features

  • TypeScript first - Full type safety and IntelliSense
  • Wallet agnostic - Works with ethers v5 and viem
  • Support for multiple product types:
    • Edition
    • Blind Mint
  • Complete purchase flow:
    • Product data fetching
    • Eligibility checking
    • Price simulation
    • Transaction preparation
    • Cross-chain support (coming soon)
    • Error handling
  • Built-in provider fallbacks - Automatic failover between multiple RPC endpoints

📦 Installation

npm install @manifoldxyz/client-sdk

🚀 Quick Start

1. Import and Initialize

import { createClient, createPublicProviderWagmi } from '@manifoldxyz/client-sdk';
import { createConfig, http } from '@wagmi/core';
import { mainnet, base } from '@wagmi/core/chains';

// Create Wagmi config
const config = createConfig({
  chains: [mainnet, base],
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});

// Create public provider
const publicProvider = createPublicProviderWagmi({ config });

// Initialize the SDK client
const client = createClient({ publicProvider });

2. Get Product Data

const url = 'https://manifold.xyz/@meta8eth/id/4150231280';
const product = await client.getProduct(url); // can also use instanceId directly
const status = await product.getStatus();
console.log(`Currently ${status}`);

3. Check Eligibility & Price

const address = '0x...';
let preparedPurchase;

try {
  preparedPurchase = await product.preparePurchase({
    userAddress: address,
    payload: {
      quantity: 1,
    },
  });
} catch (error) {
  console.log(`Unable to prepare purchase: ${error.message}`);
  return;
}

console.log(`Total cost: ${preparedPurchase.cost.total.formatted}`);

4. Execute Purchase

// Using viem
import { createAccountViem } from '@manifoldxyz/client-sdk';
import { createWalletClient, custom } from 'viem';
import { mainnet } from 'viem/chains';

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum),
});
const account = createAccountViem({ walletClient });

// Or using ethers v5
import { createAccountEthers5 } from '@manifoldxyz/client-sdk';
const account = createAccountEthers5({ signer });

const order = await product.purchase({
  account,
  preparedPurchase,
});

console.log(order.receipts[0].txHash, order.status);

📚 API Reference

Client Creation

createClient(config)

Creates a new SDK client instance.

Parameters:

  • config (object, required): Configuration options
    • publicProvider (IPublicProvider, required): Provider for blockchain interactions
    • debug (boolean, optional): Enable debug logging

Example:

import { createClient, createPublicProviderWagmi } from '@manifoldxyz/client-sdk';
import { createConfig, http } from '@wagmi/core';
import { mainnet, base } from '@wagmi/core/chains';

// Setup Wagmi config
const config = createConfig({
  chains: [mainnet, base],
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});

// Create public provider
const publicProvider = createPublicProviderWagmi({ config });

// Create client
const client = createClient({ publicProvider });

// With debug logging
const client = createClient({ publicProvider, debug: true });

Client Methods

client.getProduct(instanceIdOrUrl)

Fetches detailed product information.

Parameters:

  • instanceIdOrUrl (string): Manifold instance ID or Manifold Product URL

Returns: EditionProduct | BlindMintProduct

Example:

const product = await client.getProduct('4150231280');
// or
const product = await client.getProduct('https://manifold.xyz/@creator/id/12345');

Product Methods

product.getStatus()

Returns the current status of the product.

Returns: 'active' | 'paused' | 'completed' | 'upcoming'

product.getAllocations(params)

Check allocation quantity for a wallet address.

Parameters:

  • recipientAddress (string): Buyer's wallet address

Returns:

{
  isEligible: boolean;
  reason?: string;
  quantity: number;
}

product.preparePurchase(params)

Simulates purchase to check eligibility and get total cost.

Parameters:

  • userAddress (string): The address making the purchase
  • recipientAddress (string, optional): If different than address
  • networkId (number, optional): Force transaction on specific network
  • payload (object, optional): Product-specific parameters
    • For Edition: { quantity: number, code?: string }
    • For BlindMint: { quantity: number }
  • gasBuffer (object, optional): Additional gas configuration

Returns: PreparedPurchase with cost breakdown and transaction steps

product.purchase(params)

Executes the purchase transaction(s).

Parameters:

  • account: Wallet account adapter (see Wallet Adapters section)
  • preparedPurchase: Result from preparePurchase()

Returns: Order with transaction receipts and status

🔧 Product Types

Edition Product

interface EditionProduct {
  type: 'edition';
  totalSupply?: number;
  maxPerWallet?: number;
  price: bigint;
  startTime?: Date;
  endTime?: Date;
  // ... base properties
}

Blind Mint Product

interface BlindMintProduct {
  type: 'blind-mint';
  revealTime?: Date;
  maxSupply?: number;
  // ... base properties
}

🔌 Wallet Adapters

The SDK supports multiple wallet libraries through adapters:

Viem

import { createWalletClient, custom, http } from 'viem';
import { mainnet } from 'viem/chains';
import { createAccountViem } from '@manifoldxyz/client-sdk';

// Using browser wallet (MetaMask, etc.)
const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum),
});
const account = createAccountViem({ walletClient });

// Using private key
import { privateKeyToAccount } from 'viem/accounts';
const viemAccount = privateKeyToAccount('0x...');
const walletClient = createWalletClient({
  account: viemAccount,
  chain: mainnet,
  transport: http(),
});
const account = createAccountViem({ walletClient });

Ethers v5

import { ethers } from 'ethers';
import { createAccountEthers5 } from '@manifoldxyz/client-sdk';

// Using MetaMask or other browser wallet
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const account = createAccountEthers5({ signer });

// Using a private key
const wallet = new ethers.Wallet(privateKey, provider);
const account = createAccountEthers5({ signer: wallet });

🧪 Testing

Run the playground to test the SDK:

pnpm run playground

Or run the test suite:

pnpm test

🏗️ Development

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Run tests
pnpm test

# Run linting
pnpm run lint

# Type check
pnpm run typecheck

📄 License

MIT © Manifold

🔗 Links