@rail402.dev package to install for the job in front of you, and how the umbrella SDK relates to the building blocks underneath it.
Every package is published to npm under the @rail402.dev scope (the scope has a dot, which npm allows) and every one is Apache-2.0. Install them with npm, never by cloning the repository.
Start here
Most projects only need one of these three. Pick by what you are building.@rail402.dev/sdk
Build a buyer or a seller into your own app. One import covers search, pay, and discovery metadata. See SDK reference.
@rail402.dev/cli
Pay, search, and inspect settlements from a terminal or an AI agent. See CLI reference.
@rail402.dev/facilitator
Run the facilitator service, or settle in-process inside your own resource server. See Run a facilitator.
Every package
The umbrella: @rail402.dev/sdk
@rail402.dev/sdk re-exports three packages so a buyer, a seller, and error handling all come from one install:
- the buyer helpers from
@rail402.dev/agent-helpers(searchBazaar,payAndFetch,discoverAndPay), - the seller helpers from
@rail402.dev/seller-helpers(describeEndpoint,describeTool,preflight), - the error registry from
@rail402.dev/errors.
Front door versus building blocks
The front door is@rail402.dev/sdk, @rail402.dev/cli, and @rail402.dev/facilitator. The rest are building blocks that the SDK and the facilitator compose for you. You can still install a building block on its own when you want a single piece.
The
@x402/* packages (@x402/core, @x402/stellar, @x402/mcp, @x402/extensions) are the upstream x402 SDK, not part of Rail402. A stock @x402 client interoperates with Rail402 with no @rail402.dev package installed. See the FAQ.Next steps
SDK reference
Buyer and seller function signatures, the config object, and the Result type.
CLI reference
Every command, the
--json envelope, and config precedence.Buyer quickstart
Discover and pay a Stellar resource end to end.
Seller quickstart
Expose a paid API that catalogs itself in the Bazaar.