BentoSDK

Overview

Official documentation for @bento.fun/sdk — prediction markets, packs, parlays, tournaments, fantasy, and realtime.

@bento.fun/sdk is the TypeScript SDK for building on Bento: prediction markets, packs, parlays, bracket tournaments, F1, fantasy, portfolio, social, and realtime.

The SDK is designed for:

  • browser apps (React, Next.js)
  • React Native / Expo
  • backend jobs and scripts
  • agents and server-to-server integrations
  • tests and CI

What we standardize around

  • createBentoSdk() — top-level factory
  • Two API hosts — markets (baseUrl) and tournaments (tournamentsBaseUrl)
  • public / user / realtime on the markets host
  • tournaments namespace when the parlay/tournaments host is configured
  • onchain optional orchestration (parlay placement, vault deposit/claim, LP)
  • OpenAPI-contract types — pinned snapshots for both hosts
  • HTTP acceptance ≠ chain finality — poll reads, waitFor* helpers, or websocket

Wallet UX (Privy, Wagmi, Turnkey, server signers) stays in your app. The SDK accepts headers and viem-compatible wallets — it does not embed a wallet provider.

Shape of the product

A typical integrator flow:

  1. Configure createBentoSdk({ baseUrl, tournamentsBaseUrl, auth, tournamentsAuth })
  2. Discoverpublic.listDuels, tournaments.parlay.listMarkets, analytics
  3. Authenticatepublic.auth.eoaLogin or wallet headers; JWT on tournaments host
  4. Participate (HTTP)user.placeBet, parlay.createQuote, tournaments.enter
  5. Participate (on-chain)onchain.placeParlayFromQuoteId, vault deposit, LP
  6. Realtimerealtime websocket + subscribeTournamentAblyChat
  7. Create — duels, parent markets, bracket tournaments, F1/fantasy (creator paths)

Current primitives

LayerWhat it is today
Markets hostDuels, bets, packs, portfolio, withdrawals, Polymarket bridge
Tournaments hostParlay engine, bracket tournaments, F1, fantasy, social, agents
On-chainParlay router, tournament vault, LP via OnchainOrchestrator + viem
Not in public SDKBot API, inbound webhooks, infra meta (/api/meta/*)

New to Bento (app integrator):

  1. Quickstart
  2. Common patterns
  3. TypeScript SDK
  4. SDK API reference
  5. Two API hosts
  6. Authentication
  7. Place a bet
  8. Place a parlay
  9. Test the SDK

Creators and operators:

  1. Create a market
  2. Create a tournament
  3. Enter a tournament — player flow
  4. Mutation semantics
  5. OpenAPI reference

Agents and server-to-server:

  1. AuthenticationagentV1AuthProvider, bulkRegisterAuthProvider
  2. TypeScript SDKagentsV1, agentsExternal, bulkRegister

Install

npm install @bento.fun/sdk

Current SDK version: 0.5.3

Next steps

On this page