Skip to main content

Requirements

  • Node.js 18+ or Bun
  • A Solana wallet (keypair) with SOL on devnet for account rent
  • A Solana RPC endpoint (Helius, QuickNode, or the public devnet URL)

Install the SDK

@sigil-xyz/sdk has peer dependencies on @coral-xyz/anchor and @solana/web3.js — install them explicitly alongside the SDK.

Install the x402 middleware

If you are building a service that gates API endpoints by Sigil credentials:
The package exposes two subpaths:
ImportUse for
@sigil-xyz/x402Express middleware + agent header builder
@sigil-xyz/x402/nextNext.js App Router wrapper

Set up a connection

Use a dedicated RPC URL from Helius or QuickNode in production. The public devnet endpoint is rate-limited.

Construct a SigilClient

SigilClient takes a Connection and a wallet that can sign transactions.
The wallet field accepts any object with publicKey, signTransaction, and signAllTransactions — this matches the AnchorProvider["wallet"] interface. In a browser, pass a wallet adapter directly.