Test the SDK
Verify @bento.fun/sdk from npm with the integration sandbox before shipping your app.
Use the sdk-sandbox repo — a standalone project that installs @bento.fun/sdk from npm (not the monorepo workspace link). This catches publish issues, broken exports, and live API mismatches early.
Setup
git clone https://github.com/Bentodotfun/sdk-sandbox.git
cd sdk-sandbox
cp .env.example .env
# BENTO_URL=https://mainnet-server.bento.fun
# PARLAY_TOURNMENT_URL=https://your-tournaments-host
npm install
npm run test:import # start here — no network
npm test # full live public API checksWhat npm test runs
| Step | Checks |
|---|---|
| import-smoke | Package imports, createBentoSdk() factory |
| markets-public | listDuels, protocolStats, getDuelById (with duelId) |
| tournaments-public | parlay.listMarkets, tournaments.list |
Individual scripts:
npm run test:import
npm run test:markets
npm run test:tournamentsEnvironment
| Variable | Purpose |
|---|---|
BENTO_URL | Markets host |
PARLAY_TOURNMENT_URL | Tournaments / parlay host |
Omit PARLAY_TOURNMENT_URL to skip tournaments checks.
When to run
- After publishing a new
@bento.fun/sdkversion to npm - Before updating docs examples or integration guides
- When debugging “works in monorepo but not from npm”
- Onboarding new developers or interns testing the SDK
Fix issues in the right place
| Finding | Fix in |
|---|---|
| Wrong route or method in SDK | packages/sdk in bento.fun → publish patch |
| Docs example wrong | packages/documentation/content/docs/ |
| Sandbox test gap | sdk-sandbox |
| Backend contract changed | Re-pin OpenAPI → pnpm docs:pin:markets |
| Response shape mismatch | SDK types, docs common patterns, sandbox assertions |
Related
- sdk-sandbox on GitHub
- Common patterns —
duelId, wrapped responses, auth - OpenAPI workflow — pin contracts from backends