Skip to content

Installation

The SDK ships as a single npm package, dual-published for Node and browser environments. It is written in TypeScript with type definitions included.

Terminal window
npm install realtimeodds
# or
pnpm add realtimeodds
# or
yarn add realtimeodds

The package is published on the public npm registry: realtimeodds.

No additional setup required. Types are bundled.

import { createClient, type SportEvent } from 'realtimeodds'

The SDK targets Node 18+ (uses the global WebSocket API in newer versions, falls back to ws automatically in the Node bundle).

A browser-targeted bundle is selected automatically by your bundler via the package.json exports map. Tested with Vite, webpack 5, esbuild, and Rollup. The browser bundle uses the native WebSocket global.

  • A WebSocket gateway URL — typically wss://api.realtimeodds.xyz.
  • An API key — see Authentication.

Once you have those, head to the Quickstart.