logo

GraphQL Subscriptions (WebSockets)

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.

🛡️ Why the init payload ?

For integrators building advanced clients, here’s how auth is handled on the server:
  • The token field in the WebSocket connection_init payload 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)