1. Set up access
- Create an account or log in.
- Select your organisation and an eligible paid plan with WebSockets access. Free signup alone does not enable streams.
- Open Endpoints → WebSockets → API keys and create a credential with
stream.read. Save the secret when it is shown. - Set
BRAVADO_API_KEYandBRAVADO_API_SECRETin your server environment. Never put the secret in browser code, a URL or source control.
2. Connect and receive trades
Installws with npm install ws. Save the following as stream.mjs, then run node stream.mjs with your environment variables set.
Node.js
snapshot, then trade frames. No subscription message is needed. Node’s ws client responds to heartbeat pings automatically. See the trade frame reference.
Generate a new timestamp and signature for every reconnect. This example ends after 30 seconds; it is not a production reconnect loop. Use backoff in your application and inspect authentication failures before retrying.
3. Check your usage
Open Usage and Billing in the same Console organisation that owns the key. Messages and credits are different units: the current stream tariff is 1 credit per 100,000 delivered uncompressed UTF-8 bytes, not one credit per message or per connection. Heartbeats and errors are not billed. Usage is batched while connections remain open. Allow about a minute, then refresh. Home’s activity window and Billing’s current cycle can cover different periods. Use the same organisation and period when comparing Console and Admin.4. Add order books or trader analytics
- Use an
assetIdfrom a trade with the authenticated order-book guide. It supports Polymarket and Predict.fun when your organisation has access to the venue. - Query the trader’s history with the Trader Data API, using a credential with
analytics.readand its own HMAC signature. A WebSockets-only key does not grant Analytics access. - For order execution, follow the separate Trade quickstart.
Troubleshooting
- 401: check the matching key and secret, current millisecond timestamp and exact signed path. Keep your system clock synchronized.
- 403: inspect the error code and confirm scope, plan and venue access. Creating an endpoint does not grant these permissions.
- Connected but no updates: inspect snapshot/status/error frames and market activity; a successful handshake alone does not prove data delivery.
- No Console usage: confirm you used the authenticated
/stream/.../partnerroute and selected the key’s organisation. Legacy Terminal URLs are not a replacement for this integration.