The ruleset stream
const url = 'https://example.com/sdk/v1/stream';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/sdk/v1/stream \ --header 'Authorization: Bearer <token>'A server-sent event stream telling the SDK each new ruleset version of its environment, as soon as this replica has loaded it. It carries versions only, never a document: the SDK fetches the ruleset (server key) or evaluates again (client key) when it hears one.
The first frame is retry: 3000. Each version is a frame
event: ruleset, id: <version>, data: {"version":<version>}.
The current version is sent at once when it is above
Last-Event-ID (an unreadable one counts as none), and the versions
sent only increase. A comment : hb every 15 seconds tells a quiet
stream from a dead one; on each the key is checked again, and a
refused key ends the stream. The server closes a stream after about
an hour (60 minutes plus up to 5 of jitter) and when it shuts down;
the SDK reconnects with Last-Event-ID. A replica that is already
shutting down answers a new stream 503 unavailable with
Retry-After rather than open it and close it at once.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The last version the SDK heard.
Query Parameters
Section titled “Query Parameters”A client key, for a browser EventSource, which cannot set Authorization.
Responses
Section titled “Responses”The stream, held open.
Headers
Section titled “Headers”no-cache.
no, so a proxy passes each frame on at once.
The requests the window allows.
The requests left in the window.
sdk_key_missing without a key, with WWW-Authenticate: Bearer;
sdk_key_invalid, sdk_key_revoked or sdk_key_expired, with
WWW-Authenticate: Bearer error="invalid_token".
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}Headers
Section titled “Headers”key_kind_not_allowed (a client key at the ruleset),
server_key_in_query, server_key_from_browser or
origin_not_allowed.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}rate_limited: the window is spent.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}Headers
Section titled “Headers”Seconds to wait before trying again, at least 1.
The requests the window allows.
The requests left in the window.
Seconds until the window ends, at least 1.
ruleset_unavailable (this replica cannot load the environment’s
ruleset yet) or unavailable (the key could not be checked, or this
replica is shutting down and takes no new stream), with
Retry-After.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}Headers
Section titled “Headers”Seconds to wait before trying again, at least 1.