@buckspay/core is the platform-agnostic heart of the SDK. You can use it directly - without
any React layer - in Node.js scripts, backend workers, or any environment where you control
the signer manually.
The surface is the same three-phase flow described in Prepare -> Sign -> Send:
createBuckspayClient assembles the client; createRpcSimContext gives prepare() a Soroban
simulator; then connect() -> pay() (or the split prepare / sign / send) executes the
payment.
import { createBuckspayClient, createRpcSimContext } from "@buckspay/core";
import { classicAccount } from "@buckspay/accounts/classic";
import { walletsKit } from "@buckspay/signers/wallets-kit";
import { buckspayFacilitator } from "@buckspay/relayer/buckspay-facilitator";
const client = createBuckspayClient(
{
network: "testnet",
account: classicAccount(),
signer: walletsKit({ network: "testnet" }),
relayer: buckspayFacilitator({ url: "/api/gasless", network: "testnet" }),
gas: { mode: "sponsored" }
},
createRpcSimContext("https://soroban-testnet.stellar.org")
);
When to use the core directly
| Scenario | Recommended approach |
|---|---|
| React / React Native app | @buckspay/react or @buckspay/react-native |
| Next.js App Router BFF route | @buckspay/nextjs |
| Node.js script, backend worker, or CLI | @buckspay/core directly |
| Server-side relay (any framework) | createBuckspayClient + buckspayFacilitator({ apiKey }) - server-only |
When using
@buckspay/core in a server-side relay, pass apiKey to buckspayFacilitator
as an environment variable. The API key must never appear in a browser bundle.Full quickstart example
Next
Quickstart
The full quickstart walkthrough with a classic G-address account.
Prepare -> Sign -> Send
The three-phase flow and where the BFF slot fits.

