Centrifugo v5 migration from v4 should be smooth for most of the use cases.
Client SDK token behaviour adjustments
In Centrifugo v5 client SDK spec was adjusted in regards how SDKs work with tokens.
Returning an empty string from
getToken function. We updated all our SDKs to inherit this behaviour. Specifically, here is a list of SDK versions which work according to adjusted spec:
- centrifuge-js >= v4.0.0
- centrifuge-go >= v0.10.0
- centrifuge-dart >= v0.10.0
- centrifuge-swift >= v0.6.0
- centrifuge-java >= v0.3.0
Nothing prevents you from updating Centrifugo v4 to v5 first and then migrate to new client versions or doing vice versa. This change is client-side only. But we bind it to major server release to make it more notable – as it changes the core SDK behavior.
Node communication format changed
Avoid running Centrifugo v5 in the same cluster with Centrifugo v4 nodes – v4 and v5 have backwards incompatible node communication protocols.
Old HTTP API format is DEPRECATED
Prefer using new HTTP API format instead of old one where possible. The old format still works and enabled by default. But we are planning to migrate our API libraries to the new format eventually – and then remove the old format. If you are using one of our HTTP API libs - at some point a new version will be released which will seamlessly migrate you to the modern HTTP API format.
If you are using hand-written requests – then some refactoring is required. It should be rather straighforward:
- replace request path from
- replace payload from having
paramson top level. Payload does not include method and params keys anymore. Please refer to: https://centrifugal.dev/blog/2023/06/29/centrifugo-v5-released#new-http-api-format
- prefer using
X-API-Key: <YOUR_API_KEYheader format instead of
Authorization: apikey <YOUR_API_KEY.
Don't forget that you can now generate HTTP clients from OpenAPI spec we now maintain for the new HTTP API format.
reconnectflag removed from disconnect API call and proxy structures for custom disconnection
Shutting down Centrifugo v2 doc site
With Centrifugo v5 release we are shutting down Centrifugo v2 documentation site - this means
https://centrifugal.github.io/centrifugo/ won't be available anymore. Documents may still be found on Github. Documentation for v3, v4 and v5 is hosted here.