WebSocket API

DeployRamp provides a WebSocket connection for real-time flag updates. The SDKs connect automatically on initialization; you typically don't need to use this directly. This reference is useful if you are building a custom integration or want to understand the underlying protocol.

Endpoint

wss://flags.deployramp.com/ws?token=<public_token>

Pass your project's public token as the token query parameter when establishing the connection.

Message types

The server pushes messages when flag state changes. Each message is a JSON object with a type field:

{
  "type": "flag_updated",
  "flag": {
    "name": "new-checkout",
    "enabled": true,
    "rolloutPercentage": 75
  }
}

Connection behavior

  • Persistent connection: the WebSocket stays open for the lifetime of the client. The SDKs handle reconnection automatically if the connection drops.
  • Immediate updates: flag changes are pushed to all connected clients as soon as they occur. No polling is needed.
  • Custom integrations: if you are building a custom client, implement reconnection with exponential backoff. Listen for flag_updated messages and update your local flag state accordingly.

We use cookies to analyze site usage and improve your experience.