BentoSDK

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 checks

What npm test runs

StepChecks
import-smokePackage imports, createBentoSdk() factory
markets-publiclistDuels, protocolStats, getDuelById (with duelId)
tournaments-publicparlay.listMarkets, tournaments.list

Individual scripts:

npm run test:import
npm run test:markets
npm run test:tournaments

Environment

VariablePurpose
BENTO_URLMarkets host
PARLAY_TOURNMENT_URLTournaments / parlay host

Omit PARLAY_TOURNMENT_URL to skip tournaments checks.

When to run

  • After publishing a new @bento.fun/sdk version 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

FindingFix in
Wrong route or method in SDKpackages/sdk in bento.fun → publish patch
Docs example wrongpackages/documentation/content/docs/
Sandbox test gapsdk-sandbox
Backend contract changedRe-pin OpenAPI → pnpm docs:pin:markets
Response shape mismatchSDK types, docs common patterns, sandbox assertions

On this page