Basta’s Client API supports GraphQL subscriptions over WebSockets to deliver near real-time updates to connected clients.
These updates enhance the responsiveness and interactivity of auction experiences — especially near the end of a sale when timing and feedback are critical.
✅ Subscriptions support both unauthenticated and authenticated access via bidder tokens.
Near real-time updates for connected clients are achieved with GraphQL subscriptions. These updates enhance the auction experience and play a crucial part near the end of an auction.
⚙️ Connection Details
- Endpoint:
wss://client.api.basta.app/query
- Protocol: GraphQL over WebSocket (
graphql-ws)
- Ping/Pong: Automatic keep-alive every 10 seconds
🔐 Authentication
To authenticate, send a bidder token in the
initPayload when establishing the WebSocket connection:json{ "type": "connection_init", "payload": { "token": "<BIDDER_JWT_TOKEN>" } }
If no token is provided, the connection is treated as unauthenticated.
If you’re using the graphql-ws package you can use the connectionParams to provide the bidder token like so:
javascriptconnectionParams: () => { return { token: bidderToken, }; },
🛡️ Why the init payload ?
For integrators building advanced clients, here’s how auth is handled on the server:
- The
tokenfield in the WebSocketconnection_initpayload is validated via JWT
- Valid claims are injected into the request context
- Bids and subscriptions are scoped to the authenticated
userId
📡 Available Subscriptions
saleActivity(saleId, itemIdFilter)