Skip to main content

Custom Frontend Overview

You can build your own prediction markets UI instead of embedding our widget. Your frontend calls the platform API directly for events, markets, odds, and bets, and you own every pixel.

These pages cover the frontend only. Your backend integration is the Standalone integration, unchanged.

What stays the same​

Steps 1 to 3 of the Standalone Quick Start apply unchanged. Implement them first:

StepWhat you buildReference
1The three wallet endpoints on your serverWallet Endpoints
2HMAC signature verification on all threeWallet Endpoints
3The session endpoint and the auth endpointAuthentication Flow

Step 4 of that guide embeds the widget in an iFrame. A custom frontend replaces that step. The rest of this branch describes what you build instead.

Base URLs​

Both URLs use the predictions hostname your account manager assigns you. It is the same hostname that serves the widget.

SurfaceURL
RESThttps://<your predictions host>/api/v1
WebSocketwss://<your predictions host>/ws/connection/websocket

Take both from your own configuration. Never derive the WebSocket URL from window.location: your page is served from your own domain, and the path does not exist there.

Call the REST API​

Call https://<your predictions host>/api/v1 from the browser with the platform JWT in the Authorization header. Routing those calls through your own backend instead is supported, and it keeps the platform JWT off the browser.

The WebSocket is browser-only either way. It connects to the platform directly, which is why origin registration is mandatory.

Register your origins​

Give your account manager every origin your frontend is served from. Onboarding writes them to the REST allowlist and to the WebSocket allowlist.

Registration is mandatory. An unregistered origin fails the WebSocket handshake with a 403.

Send the exact origin string, including the scheme and the port. The match is exact: https://app.example.com does not admit http://app.example.com, and it does not admit https://app.example.com:8443.

Read the rest in this order​

  1. Authentication turns an operator session into a platform JWT.
  2. Events & Markets lists what a bettor can bet on.
  3. Placing Bets covers odds, payout, placement, and settlement.
  4. Real-Time Odds subscribes to live price changes.
  5. Security & Limitations lists what you must not do, and the platform behavior to design around.