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 rather than a local link. This catches publish issues, broken exports, and live API mismatches early.

By the end: you'll have run the published SDK against the live API in a clean project.

Setup

git clone https://github.com/Bentodotfun/sdk-sandbox.git
cd sdk-sandbox
cp .env.example .env
# BENTO_URL=https://internal-server.bento.fun
# BENTO_BUILDER_API_KEY=bnt_…   # mint at docs /concepts/builder-api-key
# PARLAY_TOURNAMENT_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-publictournaments.list

Individual scripts:

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

Environment

VariablePurpose
BENTO_URLMarkets host (https://internal-server.bento.fun)
BENTO_BUILDER_API_KEYBuilder API key (createBentoSdk requires it)
PARLAY_TOURNAMENT_URLTournaments host

Omit PARLAY_TOURNAMENT_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 locally but not from npm”
  • Onboarding new developers or interns testing the SDK

Where a mismatch comes from

SymptomWhat it means, and what to do
A route or method the SDK calls is wrong or missingAn SDK bug. Pin your last working @bento.fun/sdk version, report it to the Bento team; the fix ships in a new release.
A code example in these docs is wrongA docs bug. Report it; check the changelog for a corrected pattern.
A gap in your test coverageAdd a case to your sdk-sandbox clone.
A response shape or field changedUpgrade to the latest @bento.fun/sdk; its types track the API. See the changelog.
A response shape you did not expectConfirm you are on the latest SDK, then see common patterns (duelId, wrapped responses, auth).

On this page