BentoSDK

Two API hosts

You usually only need one host to start. Here's the split, and when to add the second.

Bento runs on two hosts, and the SDK routes each call to the right one. You only need the markets host to start. Add the tournaments host when you reach tournaments.

Markets host: baseUrl

https://internal-server.bento.fun (testnet). Where you start: bets, packs, create-market, and portfolio.

ClientProductsAuth
sdk.publiccatalog, packs, analyticsNone (open reads)
sdk.public.auth / weblinklogin, register, exchangeBuilder API key
sdk.userbets, create market, withdrawBuilder API key + Bearer JWT

Tournaments host: tournamentsBaseUrl

Set it (via the PARLAY_TOURNAMENT_URL env var) only when you need bracket tournaments or F1. Omit it and sdk.tournaments / sdk.onchain are undefined.

ClientProducts
sdk.tournamentsbracket tournaments, F1, LP pool

Auth differs per host

  • Builder key: required apiKey on createBentoSdkx-builder-api-key for auth + user routes (catalog reads skip it). Mint one.
  • Markets user: a Bearer JWT from eoaLogin, injected via walletAuthProvider.
  • Tournaments user: a JWT (tournamentsAuth) or x-wallet-address + x-signature + x-timestamp signature headers.
const sdk = createBentoSdk({
  baseUrl: 'https://internal-server.bento.fun',
  apiKey: process.env.BENTO_BUILDER_API_KEY!,
  tournamentsBaseUrl: process.env.PARLAY_TOURNAMENT_URL, // optional: add when you need it
  auth: walletAuthProvider(() => ({ Authorization: `Bearer ${token}` })),
  tournamentsAuth: jwtAuthProvider({ getAccessToken: () => token }),
});

Building only tournaments? Use createTournamentsSdk({ baseUrl: tournamentsBaseUrl, auth }).

On this page