Repository navigation
Release 2.0.0 - #729
Merged
Merged
Release 2.0.0#729
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
splindsay-92
approved these changes
Nov 2, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 2.0.0 release makes it clear what to use on a device and what to use on a server. The SDK is now published as
github.com/ably/ably-pubsub-go/v2and is split by where your code runs. Importserver/pubsubfor code that runs on your own infrastructure, ordevice/pubsubfor code that runs on an end user's device. Each package offers only the clients and APIs that make sense on its side, so device code can't reach for server-only APIs by mistake. The import paths are also what coding assistants see, so they get the choice right too.Configuring which Ably endpoint to connect to is simpler: a single
WithEndpointoption replaces the separate environment and host options, and old host options now fail to compile instead of silently connecting somewhere else.v2 also removes the APIs and client options deprecated in v1.
Below is an overview of the major changes in this release. Please refer to the migration guide for the full details, including a list of all breaking changes and instructions on how to address them.
Per-side packages
The
github.com/ably/ably-go/ablypackage no longer exists. Import the package for the side of the connection your code runs on:github.com/ably/ably-pubsub-go/v2/server/pubsubfor code that runs on infrastructure you operate and authenticates with an API key. It offers a realtime client,RealtimeClient, and an HTTP client,HTTPClient, created withNewRealtimeClientandNewHTTPClient. Server connections are exempt from monthly-active-user counting.github.com/ably/ably-pubsub-go/v2/device/pubsubfor applications on end-user devices, identified by aclientIdand authenticated with tokens issued by your server. It offers a single realtime client,Client, created withNewClient, and leaves out the HTTP-only API.Both packages are named
pubsuband re-export everything they need — channels, messages, presence, options and errors — so an application imports exactly one of them. The re-exports are type aliases, so the types are the same in both packages. The implementation now lives underinternal/and can no longer be imported directly.#713, #718, #727
Client API naming
RESTprefix is nowHTTP, so type names describe the transport:ably.RESTispubsub.HTTPClient,ably.NewRESTispubsub.NewHTTPClient, andRESTChannel,RESTChannels,RESTPresence,RESTRequestandRESTPaginatedItemsbecomeHTTPChannel,HTTPChannels,HTTPPresence,HTTPRequestandHTTPPaginatedItems.WithIdempotentRESTPublishingkeeps its name, which comes from the specification. #713, #726ably/objectsto the sharedgithub.com/ably/ably-pubsub-go/v2/objectspackage. #724ably-pubsub-go/<version>in theAbly-Agentheader, together withably-pubsub-serverorably-pubsub-device. Update any proxy rules or log queries that match onably-go/. #713, #722Server authentication
Clients from
server/pubsubdeclare themselves as servers. Authenticate them with an API key; token authentication works only with a token carrying the signedx-ably-clientType=serverclaim, which today means a JWT. Other tokens are rejected with error 40167. Clients fromdevice/pubsubare not affected. #722Endpoint configuration
WithEnvironment,WithRESTHost,WithRealtimeHostandWithFallbackHostsUseDefaultare removed in favour ofWithEndpoint, which selects the host for both HTTP requests and the realtime connection. For example,WithEnvironment("sandbox")becomesWithEndpoint("nonprod:sandbox"). Default fallback hosts now apply automatically, and a custom port no longer disables them. Clients that set no host option connect to the same hosts as before; if you used the removed options, check your firewall or proxy rules before upgrading. #719Channel release
Channels.Releaseno longer takes acontext.Contextand no longer detaches the channel for you. It returns an error with codeErrChannelReleaseInvalidState(90011) unless the channel isINITIALIZED,DETACHEDorFAILED, so detach the channel first. A channel that is already in one of those states is released without a detach attempt, so aFAILEDchannel, or one on a closing or failed connection, can now be released; previouslyReleasereturned an error and left it in place. #716, #717, #728Removed APIs
Connection.RecoveryKey()is removed; useConnection.CreateRecoveryKey().RESTChannel.PublishMultipleWithOptionsis removed; useHTTPChannel.PublishMultiple.PublishMultipleWithParamsis removed; usePublishWithParams.